3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array('test' => array('percy' => array('hello' => 'hatcherson'), 'percy' => array('mitchell', 'anderson'))); $combined = array(); foreach ($arr as $k => $v) { $combined[] = array_intersect_key($arr, array_flip($allowed)); } var_dump($res);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: allowed in /in/W9DAh on line 10 Warning: array_flip() expects parameter 1 to be array, null given in /in/W9DAh on line 10 Warning: array_intersect_key(): Argument #2 is not an array in /in/W9DAh on line 10 Notice: Undefined variable: res in /in/W9DAh on line 15 NULL
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: allowed in /in/W9DAh on line 10 Warning: Invalid operand type was used: array_flip expects an array or collection in /in/W9DAh on line 10 Warning: array_intersect_key() expects parameter 2 to be an array or collection in /in/W9DAh on line 10 Notice: Undefined variable: res in /in/W9DAh on line 15 NULL
Output for 5.1.0 - 5.2.17
Notice: Undefined variable: allowed in /in/W9DAh on line 10 Warning: array_flip(): The argument should be an array in /in/W9DAh on line 10 Warning: array_intersect_key(): Argument #2 is not an array in /in/W9DAh on line 10 Notice: Undefined variable: res in /in/W9DAh on line 15 NULL
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function array_intersect_key() in /in/W9DAh on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_intersect_key() in /in/W9DAh on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_intersect_key() in /in/W9DAh on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_intersect_key() in /in/W9DAh on line 10