The classic straightforward PHP solution.
Uses a switch statement and the PHP >= 5.4 short array syntax.
Uses a for loop with no body.
Maps a function over a range.
To test a PHP solution:
php test.php php/switch.php
To test the output of any command:
./your-command-here | php test.php