- Output for 5.3.0 - 5.3.20, 5.4.0 - 5.4.10
- Fatal error: Cannot use $this as lexical variable in 1jLQO on line 8
Process exited with code 255.
<?php
class Foo
{
protected $x = 3;
public function test()
{
return function () use ($this) {
return $this->x;
};
}
}
$foo = new Foo();
var_dump($foo->test());