3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $texts = [ 3 => 'Fizz', 5 => 'Buzz', 7 => 'Gezz' ]; echo join(', ', array_map(function($x) use ($texts) { $y = ''; foreach($texts as $d=>$text) { if($x%$d==0) $y .= $text; } return $y?:$x; }, range(1, 100)));
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1, 2, Fizz, 4, Buzz, Fizz, Gezz, 8, Fizz, Buzz, 11, Fizz, 13, Gezz, FizzBuzz, 16, 17, Fizz, 19, Buzz, FizzGezz, 22, 23, Fizz, Buzz, 26, Fizz, Gezz, 29, FizzBuzz, 31, 32, Fizz, 34, BuzzGezz, Fizz, 37, 38, Fizz, Buzz, 41, FizzGezz, 43, 44, FizzBuzz, 46, 47, Fizz, Gezz, Buzz, Fizz, 52, 53, Fizz, Buzz, Gezz, Fizz, 58, 59, FizzBuzz, 61, 62, FizzGezz, 64, Buzz, Fizz, 67, 68, Fizz, BuzzGezz, 71, Fizz, 73, 74, FizzBuzz, 76, Gezz, Fizz, 79, Buzz, Fizz, 82, 83, FizzGezz, Buzz, 86, Fizz, 88, 89, FizzBuzz, Gezz, 92, Fizz, 94, Buzz, Fizz, 97, Gezz, Fizz, Buzz
Output for 5.2.3 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/5YsJq on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.2
<br /> <b>Parse error</b>: syntax error, unexpected '[' in <b>/in/5YsJq</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
<br /> <b>Parse error</b>: parse error, unexpected '[' in <b>/in/5YsJq</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error in <b>/in/5YsJq</b> on line <b>2</b><br />
Process exited with code 255.