3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function __construct() : self { return $this; } } var_dump((new Foo)->__construct());
based on IGGs3
Output for 7.0.0
Fatal error: Constructor Foo::__construct() cannot declare a return type in /in/s9snG on line 3
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/s9snG on line 5
Process exited with code 255.