3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { public function _foo($v) { echo __METHOD__ . $v; } public function doit() { $that = $this; $closure = function() use ($this) { $this->_foo('value'); }; $that = 5; $closure(); } } $a = new A(); $a->doit();
Output for 5.3.0 - 5.4.30
Fatal error: Cannot use $this as lexical variable in /in/7Mlgq on line 13
Process exited with code 255.