3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function fizzBuzz($n) { if ($n % 3) echo "Fizz"; if ($n % 5) echo "Buzz"; echo "\n"; return $n; } foreach (range(1,100) as $n) echo fizzBuzz($n) . "\n";
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
FizzBuzz 1 FizzBuzz 2 Buzz 3 FizzBuzz 4 Fizz 5 Buzz 6 FizzBuzz 7 FizzBuzz 8 Buzz 9 Fizz 10 FizzBuzz 11 Buzz 12 FizzBuzz 13 FizzBuzz 14 15 FizzBuzz 16 FizzBuzz 17 Buzz 18 FizzBuzz 19 Fizz 20 Buzz 21 FizzBuzz 22 FizzBuzz 23 Buzz 24 Fizz 25 FizzBuzz 26 Buzz 27 FizzBuzz 28 FizzBuzz 29 30 FizzBuzz 31 FizzBuzz 32 Buzz 33 FizzBuzz 34 Fizz 35 Buzz 36 FizzBuzz 37 FizzBuzz 38 Buzz 39 Fizz 40 FizzBuzz 41 Buzz 42 FizzBuzz 43 FizzBuzz 44 45 FizzBuzz 46 FizzBuzz 47 Buzz 48 FizzBuzz 49 Fizz 50 Buzz 51 FizzBuzz 52 FizzBuzz 53 Buzz 54 Fizz 55 FizzBuzz 56 Buzz 57 FizzBuzz 58 FizzBuzz 59 60 FizzBuzz 61 FizzBuzz 62 Buzz 63 FizzBuzz 64 Fizz 65 Buzz 66 FizzBuzz 67 FizzBuzz 68 Buzz 69 Fizz 70 FizzBuzz 71 Buzz 72 FizzBuzz 73 FizzBuzz 74 75 FizzBuzz 76 FizzBuzz 77 Buzz 78 FizzBuzz 79 Fizz 80 Buzz 81 FizzBuzz 82 FizzBuzz 83 Buzz 84 Fizz 85 FizzBuzz 86 Buzz 87 FizzBuzz 88 FizzBuzz 89 90 FizzBuzz 91 FizzBuzz 92 Buzz 93 FizzBuzz 94 Fizz 95 Buzz 96 FizzBuzz 97 FizzBuzz 98 Buzz 99 Fizz 100