3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array('A', 'B'); $array2 = array('1', '2', '3'); $result = array(); foreach($array1 as $val) { foreach($array2 as $co) { $result[] = $val."".$co; } } print_r($result);
based on MSjdv
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => A1 [1] => A2 [2] => A3 [3] => B1 [4] => B2 [5] => B3 )