- Output for 5.3.0 - 5.3.20, 5.4.0 - 5.4.10
- Fatal error: Cannot use $this as lexical variable in /in/onaHt on line 8
Process exited with code 255.
<?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();