3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Vendor { public function make(); } class Samsung implements Vendor{ public function make() :string { return "This is Samsung product"; } } class Galaxy extends Samsung() { public function make() { return new Samsung(); } } $vendor = new Samsung(); echo $vendor->make();
based on tVWfu
Output for 7.0.0
Parse error: syntax error, unexpected '(', expecting '{' in /in/2pjI0 on line 12
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/2pjI0 on line 7
Process exited with code 255.