3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $x = 3; public function test() { return function () use ($this) { return $this->x; }; } } $foo = new Foo(); var_dump($foo->test());
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.

preferences:
173.26 ms | 1395 KiB | 39 Q