3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C { function foo() { return function() use ($this) { var_export($this); } } } $c = new C; $f = $c->foo(); $f();
based on nXTYJ
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '}', expecting ';' in /in/9jN8c on line 8
Process exited with code 255.
Output for 5.3.21 - 5.6.16
Fatal error: Cannot use $this as lexical variable in /in/9jN8c on line 5
Process exited with code 255.