3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sum = 0; $master = array(); $arrColors = array('R', 'B', 'G' ,'Y'); $arrNumbers = array('1', '2', '3', '4'); foreach($arrColors as $num) { foreach($arrNumbers as $color) { $temp = $color.' - '.$num; if ($num != $num) { $sum+= $num; } array_push($master, $temp); } } print_r($master); echo "\n"; print_r ("The sum is ".$sum);
based on 0JXYk