3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { $var = 1; public function fun1(){ return $this->var++; } public function fun2(){ echo preg_replace_callback('/.*/', function($find){return $this->fun1().$find[0];}, 't'); } } $t = new Test; $t->fun2(); echo 3;
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '$var' (T_VARIABLE), expecting function (T_FUNCTION) in /in/O3YGu on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/O3YGu on line 4
Process exited with code 255.