Skip to content

Instantly share code, notes, and snippets.

@phawk
Created April 18, 2011 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phawk/925135 to your computer and use it in GitHub Desktop.
Save phawk/925135 to your computer and use it in GitHub Desktop.
<?php
$start = microtime();
$x = 1;
do{
$x++;
$result = null;
$i = 0;
do{
$i++;
switch ($i) {
case ( ($i % 3 === 0) && ($i % 5 === 0) ):
$result .= 'Fizz Buzz<br />';
break;
case ($i % 3 === 0):
$result .= 'Fizz<br />';
break;
case ($i % 5 === 0):
$result .= 'Buzz<br />';
break;
default:
$result .= $i;
$result .= '<br />';
}
} while( $i < 100);
echo $result;
} while( $x < 100 );
$end = microtime();
$total = $end - $start;
echo 'Total: ' . $total;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment