- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.21
- Parse error: syntax error, unexpected '&' in /in/E3VPL on line 9
Process exited with code 255.
<?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'