3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { protected $c = ['foo' => ['bar' => 'baz']]; function __get($name) { return $c[$name]; } } $a = new A; var_dump($a->foo['bar']); $a->foo['bar'] = 'bat'; var_dump($a->foo['bar']);
Output for 5.5.0 - 7.3.0beta1
Notice: Undefined variable: c in /in/dDYW3 on line 9 NULL Notice: Undefined variable: c in /in/dDYW3 on line 9 Notice: Indirect modification of overloaded property A::$foo has no effect in /in/dDYW3 on line 17 Notice: Undefined variable: c in /in/dDYW3 on line 9 NULL