3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array('a0', 'a1', 'a2', 'a3', 'a4', 'a5'); $b = array('b0', 'b1', 'b2', 'b3', 'b4', 'b5'); for($i = 0, $sum = count($a); $i < $sum; $i+=2){ if ($i % 2 == 0) echo $a[$i] . ' ' . $b[$i] . ' ' . $a[$i + 1] . ' ' . $b[$i + 1] . "<br>"; else echo $b[$i] . ' ' . $a[$i] . ' ' . $b[$i + 1] . ' ' . $a[$i + 1] . "<br>"; }
based on XZdhe
Output for 5.3.18 - 7.3.0rc3
a0 b0 a1 b1<br>a2 b2 a3 b3<br>a4 b4 a5 b5<br>