3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { public $a = 1; public function test() { $f = function() use($this) { var_dump($this); }; $f(); } } $a = new A(); $a->test();
Output for 5.3.0 - 5.3.24, 5.3.26 - 5.4.16
Fatal error: Cannot use $this as lexical variable in /in/0KN2J on line 9
Process exited with code 255.
Output for 5.3.25
Fatal error: Cannot use $this as lexical variable in /in/Hm74J on line 9
Process exited with code 255.