3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function fun1(){ static $var = 1; echo $var++; } public function fun2(){ echo preg_replace_callback('/.*/', function($find){return $this->fun1().$find[0].'33';}, 't'); } } $t = new Test; $t->fun2();

preferences:
41.03 ms | 402 KiB | 5 Q