3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $_b; function __construc($b) { $this->_b = $b; } function __get($name) { echo "get $name \n"; return $this->{'_' . $name}; } function __isset($name) { echo "isset $name\n"; return true; } } class B { private $_c; function __construc($c) { $this->_c = $c; } function __get($name) { echo "get $name \n"; return $this->{'_' . $name}; } function __isset($name) { echo "isset $name\n"; return true; } } $c = new B('plop'); $b = new B($c); $a = new A($b); var_dump($a); var_dump(isset($a->b->c));
based on NEbvf
Output for 7.0.28 - 7.3.0rc3
object(A)#3 (1) { ["_b":"A":private]=> NULL } isset b get b bool(false)
Output for 5.6.38
object(A)#3 (1) { ["_b":"A":private]=> NULL } get b bool(false)