3v4l.org

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