3v4l.org

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