3v4l.org

run code in 500+ PHP versions simultaneously
<?php $date = array("08.2018", "08.2018", "08.2018"); $time = array("09:30", "10:30", "11:30"); $message = array("a", "b", "c"); //this are my arrays that are filled from mysql result and this works in this arrays all is all data. $iterator = new MultipleIterator(); $iterator->attachIterator(new ArrayIterator($date)); $iterator->attachIterator(new ArrayIterator($time)); $iterator->attachIterator(new ArrayIterator($message)); foreach($iterator as $i) { echo $i[0]; echo $i[1]; echo $i[2]; echo PHP_EOL; }
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
08.201809:30a 08.201810:30b 08.201811:30c

preferences:
99.72 ms | 1423 KiB | 4 Q