3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $a = 'a'; private $b = 'a'; public function __get($key) { return $this->$key; } } class B extends A { private $a = 'b'; public function __get($key) { return $this->$key; } } $a = new A(); echo $a->a; echo $a->b; $b = new B(); echo $b->a; echo $b->b;
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.21.3, 7.0.0 - 7.3.0beta1
aab Notice: Undefined property: B::$b in /in/CR4ol on line 20
Output for hhvm-3.22.0
aab Notice: Undefined property: B::$b in /in/CR4ol on line -1