3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function __get($prop) { echo 'Base: ' . $prop; } } class bar extends foo { function __get($prop) { if (strpos('_', $prop) === false) { parent::__get($prop); } else { echo 'Extended: ' . $prop; } } } $b = new bar; $b->test; $b->_test;
Output for 5.0.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Base: testBase: _test
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.4.9
Notice: Undefined property: test in /in/8uZOj on line 21 Notice: Undefined property: _test in /in/8uZOj on line 22