@ 2015-12-09T15:48:59Z <?php
interface Vendor {
public function make() : string;
}
class Samsung implements Vendor{
public function make() {
return "This is Samsung product";
}
}
$vendor = new Samsung();
echo $vendor->make();
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.27 , 8.2.0 - 8.2.17 , 8.3.0 - 8.3.4 Fatal error: Declaration of Samsung::make() must be compatible with Vendor::make(): string in /in/CJV0X on line 7
Process exited with code 255 . Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.16 - 7.3.33 Fatal error: Declaration of Samsung::make() must be compatible with Vendor::make(): string in /in/CJV0X on line 6
Process exited with code 255 . Output for 5.5.0 - 5.5.38 , 5.6.0 - 5.6.28 Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/CJV0X on line 3
Process exited with code 255 . preferences:dark mode live preview
189.83 ms | 401 KiB | 221 Q