3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $_foo = 'foo'; public function isMatch() { var_dump($this->_foo); var_dump(self::$_foo); } } class Bar extends Foo { protected $_foo = 'bar'; } $a = new Bar(); var_dump($a->isMatch());
based on VntMm
Output for 7.0.0 - 7.2.0
string(3) "bar" Fatal error: Uncaught Error: Access to undeclared static property: Foo::$_foo in /in/58PpR:8 Stack trace: #0 /in/58PpR(17): Foo->isMatch() #1 {main} thrown in /in/58PpR on line 8
Process exited with code 255.
Output for 5.3.17 - 5.6.28
string(3) "bar" Fatal error: Access to undeclared static property: Foo::$_foo in /in/58PpR on line 8
Process exited with code 255.