- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.21
- Parse error: syntax error, unexpected '&' in /in/qdRdB on line 13
Process exited with code 255.
<?php
class Foo
{
protected $bar;
public function &__get($property)
{
echo 'get';
switch ($property)
{
case 'bar':
return &$this->bar;
//etc.
}
}
public function __set($property, $value)
{
echo 'set';
switch ($property)
{
case 'bar':
$this->bar = $value;
break;
//etc.
}
}
}
$foo = new Foo();
$foo->bar = 1;
$foo->bar++;
echo $foo->bar;