3v4l.org

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

preferences:
48.29 ms | 747 KiB | 4 Q