3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dayIndex = 0; for ($i=0; $i < 10; $i++) { echo $dayIndex.PHP_EOL; $dayIndex = ($dayIndex + 1) % 3; }
Output for 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
0 1 2 0 1 2 0 1 2 0

preferences:
42.43 ms | 746 KiB | 4 Q