3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A extends \ReflectionClass { protected $name; public function __get($name) { if ('name' === $name) { return 'bla'; } return $this->$name; } } $r = new A('stdClass'); var_dump($r->name);
Output for 5.4.18 - 5.4.19
Fatal error: Access level to A::$name must be public (as in class ReflectionClass) in /in/5SnN3 on line 15
Process exited with code 255.
Output for 5.3.0 - 5.4.17
Fatal error: Access level to A::$name must be public (as in class ReflectionClass) in /in/5kSgU on line 15
Process exited with code 255.