3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $master = array(); $arrColors = array('Red', 'Blue', 'Green' ,'Yellow'); $arrNumbers = array('1', '2', '3', '4'); foreach($arrColors as $color) { foreach($arrNumbers as $num) { $temp = $color.' - '.$num; array_push($master, $temp); } } print_r($master);
based on pUAJN
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Red - 1 [1] => Red - 2 [2] => Red - 3 [3] => Red - 4 [4] => Blue - 1 [5] => Blue - 2 [6] => Blue - 3 [7] => Blue - 4 [8] => Green - 1 [9] => Green - 2 [10] => Green - 3 [11] => Green - 4 [12] => Yellow - 1 [13] => Yellow - 2 [14] => Yellow - 3 [15] => Yellow - 4 )