3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { public function other($asdf) { echo "Other: $asdf"; return true; } public function fn() { static $a = array('a', 'b', 'c', 'd'); return array_filter($a, function($n) use ($this) { $this->other($n); return true; }); } } $a = new A(); var_dump($a->fn());
Output for 5.3.0 - 5.4.19
Fatal error: Cannot use $this as lexical variable in /in/fcVVe on line 14
Process exited with code 255.