Created
November 10, 2015 23:10
-
-
Save DArcMattr/ce26997f1460f480f229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php // vim:ft=php | |
$max = intval( $argv[1] ); | |
for ( $i = 1; $i <= $max; $i++ ) { | |
$string = ''; | |
$string .= ( 0 === ( $i % 3 ) ) ? 'Fizz' : ''; | |
$string .= ( 0 === ( $i % 5 ) ) ? 'Buzz' : ''; | |
$string .= ( 0 === ( $i % 7 ) ) ? 'Baz' : ''; | |
$string .= ( '' === $string ) ? strval( $i) : ''; | |
echo $string . PHP_EOL; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment