3v4l.org

run code in 500+ PHP versions simultaneously
<?php // First class callable function a() { static $c = 0; return $c++; } $c = a(...); $c = function () { static $c = 0; return $c++; }; print $c(); print $c(); $d = clone $c; print $d(); ?>
Output for 8.2.31 - 8.2.32, 8.3.5 - 8.3.33, 8.4.9 - 8.4.24, 8.5.6 - 8.5.9
012

preferences:
27 ms | 550 KiB | 4 Q