3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return function() use ($this) { echo "in closure\n"; } } } $foo = new Foo();
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.21
Fatal error: Cannot use $this as lexical variable in /in/G28oE on line 5
Process exited with code 255.

preferences:
185.69 ms | 1395 KiB | 57 Q