3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public function bop() { $this->foo = "noop"; } } abstract class Foo { private $foo = "aa"; public function boop() { var_dump($this->foo); } } class Bar extends Foo { public function beep() { var_dump($this->foo); } } $b = new Bar(); $b->beep(); $b->boop(); $b->bop(); $b->boop();
Output for 7.0.0 - 7.1.0
Notice: Undefined property: Bar::$foo in /in/EUXGl on line 19 NULL string(2) "aa" Fatal error: Uncaught Error: Call to undefined method Bar::bop() in /in/EUXGl:27 Stack trace: #0 {main} thrown in /in/EUXGl on line 27
Process exited with code 255.
Output for 5.2.6 - 5.6.28
Notice: Undefined property: Bar::$foo in /in/EUXGl on line 19 NULL string(2) "aa" Fatal error: Call to undefined method Bar::bop() in /in/EUXGl on line 27
Process exited with code 255.
Output for 5.0.0 - 5.2.5
Notice: Undefined property: Bar::$foo in /in/EUXGl on line 19 NULL string(2) "aa" Fatal error: Call to undefined method Bar::bop() in /in/EUXGl on line 27
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/EUXGl on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/EUXGl on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/EUXGl on line 4
Process exited with code 255.