3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { protected $x=10; public function myMethod($x=0); { return $this->x; } } class B extends A { public function myMethod($x=0); { return 2*$this->x; } } ?>
based on iItl1
Output for 7.1.0 - 7.1.6
Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) or const (T_CONST) in /in/KfbqU on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /in/KfbqU on line 6
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected '{', expecting T_FUNCTION in /in/KfbqU:6 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Non-abstract method A::myMethod() must contain body in /in/KfbqU on line 5
Process exited with code 255.