3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Samsung { public function make() :string { return "This is Samsung product"; } } class Galaxy extends Samsung { public function make() { return new Samsung(); } } $vendor = new Galaxy(); echo $vendor->make();
based on gvqog
Output for 7.0.0
Fatal error: Declaration of Galaxy::make() must be compatible with Samsung::make(): string in /in/nt5Hm 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/nt5Hm on line 3
Process exited with code 255.