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"; } } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1 ImageX Media ImageX 5 ImageXMedia 7 ImageX Media ImageX 11 ImageXMedia 13 ImageX Media ImageX 17 ImageXMedia 19 ImageX Media ImageX 23 ImageXMedia 25 ImageX Media ImageX 29 ImageXMedia 31 ImageX Media ImageX 35 ImageXMedia 37 ImageX Media ImageX 41 ImageXMedia 43 ImageX Media ImageX 47 ImageXMedia 49 ImageX Media ImageX 53 ImageXMedia 55 ImageX Media ImageX 59 ImageXMedia 61 ImageX Media ImageX 65 ImageXMedia 67 ImageX Media ImageX 71 ImageXMedia 73 ImageX Media ImageX 77 ImageXMedia 79 ImageX Media ImageX 83 ImageXMedia 85 ImageX Media ImageX 89 ImageXMedia 91 ImageX Media ImageX 95 ImageXMedia 97 ImageX Media ImageX