3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo join(', ', array_map(function($x) { return $x.'['.($x%3-$x%5).']'; }, range(1, 100)));
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
1[0], 2[0], 3[-3], 4[-3], 5[2], 6[-1], 7[-1], 8[-1], 9[-4], 10[1], 11[1], 12[-2], 13[-2], 14[-2], 15[0], 16[0], 17[0], 18[-3], 19[-3], 20[2], 21[-1], 22[-1], 23[-1], 24[-4], 25[1], 26[1], 27[-2], 28[-2], 29[-2], 30[0], 31[0], 32[0], 33[-3], 34[-3], 35[2], 36[-1], 37[-1], 38[-1], 39[-4], 40[1], 41[1], 42[-2], 43[-2], 44[-2], 45[0], 46[0], 47[0], 48[-3], 49[-3], 50[2], 51[-1], 52[-1], 53[-1], 54[-4], 55[1], 56[1], 57[-2], 58[-2], 59[-2], 60[0], 61[0], 62[0], 63[-3], 64[-3], 65[2], 66[-1], 67[-1], 68[-1], 69[-4], 70[1], 71[1], 72[-2], 73[-2], 74[-2], 75[0], 76[0], 77[0], 78[-3], 79[-3], 80[2], 81[-1], 82[-1], 83[-1], 84[-4], 85[1], 86[1], 87[-2], 88[-2], 89[-2], 90[0], 91[0], 92[0], 93[-3], 94[-3], 95[2], 96[-1], 97[-1], 98[-1], 99[-4], 100[1]
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/Rlodt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/Rlodt on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/Rlodt on line 3
Process exited with code 255.

preferences:
211.81 ms | 401 KiB | 313 Q