3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for($i = 1; $i <= 100; $i++) { $retVal = ""; switch($i) { case ($i % 5 == 0): $retVal = "FizzBuzz"; break; case ($i % 3 == 0): $retVal = "Fizz"; break; case ($i % 5 == 0): $retVal = "Buzz"; break; default: $retVal = $i; } print $retVal."\n"; }
based on 4iT6S
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1 2 Fizz 4 FizzBuzz Fizz 7 8 Fizz FizzBuzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 FizzBuzz Fizz 22 23 Fizz FizzBuzz 26 Fizz 28 29 FizzBuzz 31 32 Fizz 34 FizzBuzz Fizz 37 38 Fizz FizzBuzz 41 Fizz 43 44 FizzBuzz 46 47 Fizz 49 FizzBuzz Fizz 52 53 Fizz FizzBuzz 56 Fizz 58 59 FizzBuzz 61 62 Fizz 64 FizzBuzz Fizz 67 68 Fizz FizzBuzz 71 Fizz 73 74 FizzBuzz 76 77 Fizz 79 FizzBuzz Fizz 82 83 Fizz FizzBuzz 86 Fizz 88 89 FizzBuzz 91 92 Fizz 94 FizzBuzz Fizz 97 98 Fizz FizzBuzz