3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr1 = array( 'key1a'=>'value', 'key2a'=>'value', 'key3a'=>'value' ); $arr2 = array( 'key7b'=>'value', 'key8b'=>'value', 'key9b'=>'value' ); foreach($arr1 as $i => $val) { foreach($arr2 as $j => $val2) { echo $i . " = " . $j . ", "; } } $keys = array_combine(array_keys($array1),array_keys($array2)); foreach($keys as $k => $k2) echo " $k = $k2".($k2==end($keys)?'':',');
Output for 5.3.0 - 7.1.0
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Notice: Undefined variable: array1 in /in/FJR2U on line 22 Warning: array_keys() expects parameter 1 to be array, null given in /in/FJR2U on line 22 Notice: Undefined variable: array2 in /in/FJR2U on line 22 Warning: array_keys() expects parameter 1 to be array, null given in /in/FJR2U on line 22 Warning: array_combine() expects parameter 1 to be array, null given in /in/FJR2U on line 22 Warning: Invalid argument supplied for foreach() in /in/FJR2U on line 23
Output for 5.0.4 - 5.2.1, 5.2.3 - 5.2.17
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Notice: Undefined variable: array1 in /in/FJR2U on line 22 Warning: array_keys(): The first argument should be an array in /in/FJR2U on line 22 Notice: Undefined variable: array2 in /in/FJR2U on line 22 Warning: array_keys(): The first argument should be an array in /in/FJR2U on line 22 Warning: array_combine() expects parameter 1 to be array, null given in /in/FJR2U on line 22 Warning: Invalid argument supplied for foreach() in /in/FJR2U on line 23
Output for 5.2.2

Process exited with code 137.
Output for 5.0.0 - 5.0.3
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Notice: Undefined variable: array1 in /in/FJR2U on line 22 Warning: array_keys(): The first argument should be an array in /in/FJR2U on line 22 Notice: Undefined variable: array2 in /in/FJR2U on line 22 Warning: array_keys(): The first argument should be an array in /in/FJR2U on line 22 Warning: array_combine() expects parameter 1 to be array, null given in /in/FJR2U on line 22 Warning: Invalid argument supplied for foreach() in /in/FJR2U on line 23
Output for 4.4.5 - 4.4.9
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Fatal error: Call to undefined function: array_combine() in /in/FJR2U on line 22
Process exited with code 255.
Output for 4.3.2 - 4.4.4
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Fatal error: Call to undefined function: array_combine() in /in/FJR2U on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Fatal error: Call to undefined function: array_combine() in /in/FJR2U on line 22