- Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.9
- Parse error: syntax error, unexpected '&', expecting ';' in /in/5pTS8 on line 10
Process exited with code 255.
<?php
class Foo
{
public $ref;
public function &getRef()
{
return & $this->ref;
}
public function test()
{
$this->ref = 123;
$local = $this->getRef();
$this->ref = 456;
echo $local;
}
}
(new Foo)->test();