3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { public function stuff() { $lambda = function() { static $y; $y++; }; var_dump(spl_object_hash($lambda)); var_dump($lambda()); } } $x = new Thing(); $x->stuff(); $x->stuff();

preferences:
33.05 ms | 402 KiB | 5 Q