3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { /** * @param integer $i * @return mixed */ public function test($i) { $self = $this; $test2 = function($x) use(&$test2, &$self) { var_dump($x); $x++; if ($x < 10) { $test2($x); $self->test($x); } }; $test2($i); return $i; } } $t = new c(); $t->test(1);

preferences:
55.67 ms | 405 KiB | 6 Q