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.3.5 - 8.3.31, 8.4.9 - 8.4.22, 8.5.6 - 8.5.7
012

preferences:
53.96 ms | 521 KiB | 4 Q