3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class myClass { public function add() : self { /** code **/ return $this; } } class myExtendedClass extends myClass { public function add() : parent { return $this; } } $instance = new myExtendedClass(); $instance->add();
based on Zl9aN
Output for 7.0.0 - 7.3.0rc3
Output for 5.5.0 - 5.6.23
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/mT5A2 on line 5
Process exited with code 255.