3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A1 { private function bla() { echo "a"; } public function doA() { $this->bla(); } } class B1 extends A1 { private bla() { echo "b"; } public function doB() { $this->bla(); } } $nonFinal = new B1(); $nonFinal->doA(); // outputs "b" $nonFinal->doB(); // outputs "b"
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected 'bla' (T_STRING), expecting variable (T_VARIABLE) in /in/VS1PU on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/VS1PU on line 18
Process exited with code 255.