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 . ", "; } } $newarr = array_combine(array_keys($arr1), array_keys($arr2)); echo $newarr;
Output for 5.4.0 - 7.1.0
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Notice: Array to string conversion in /in/BjAUd on line 24 Array
Output for 5.0.0 - 5.3.29
key1a = key7b, key1a = key8b, key1a = key9b, key2a = key7b, key2a = key8b, key2a = key9b, key3a = key7b, key3a = key8b, key3a = key9b, Array
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/BjAUd 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/BjAUd 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/BjAUd on line 22