3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { protected $my_var = 42; public function bar() { preg_replace_callback('/./', function($match) use ($this) { var_dump($this->my_var); }, 'a'); } } $fizz = new foo(); $fizz->bar();
Output for 5.3.0 - 5.4.10
Fatal error: Cannot use $this as lexical variable in pXhUF on line 8
Process exited with code 255.