3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class MyClass { protected $data = array('some' => array('sub' => 'data')); public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { return & $this->data[$name]; } } $my = new MyClass(); $my->some['sub'] = 'test'; // пытаемся изменить значение echo $my->some['sub']; // выведет 'data'
Output for 5.3.0 - 5.4.21
Parse error: syntax error, unexpected '&' in /in/XNH0Y on line 9
Process exited with code 255.