3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public $publicProperty = array(); } class Bar { public function __construct(Foo $foo) { $this->wrapped = $foo; } public function & __get($name) { return & $this->wrapped->$name; } } $bar = new Bar(new Foo()); $bar->publicProperty['example'] = 'Hello World!'; var_dump($bar->publicProperty);
Output for 5.3.0 - 5.3.24, 5.3.26 - 5.4.16
Parse error: syntax error, unexpected '&' in EJLoH on line 17
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected '&' in /in/EJLoH on line 17
Process exited with code 255.