Skip to content

Instantly share code, notes, and snippets.

@L-P
Created January 7, 2014 01:32
Show Gist options
  • Save L-P/7dd2714704bd3a47f0c7 to your computer and use it in GitHub Desktop.
Save L-P/7dd2714704bd3a47f0c7 to your computer and use it in GitHub Desktop.
<?php
$f = function($a) {
switch(0) {
case $a % 15:
return 'FizzBuzz';
case $a % 3:
return 'Fizz';
case $a % 5:
return 'Buzz';
default:
return $a;
}
};
array_map('printf', array_map($f, range(0, $argv[1])));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment