3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('test' => array('percy' => array('hello' => 'hatcherson'), 'percy' => array('mitchell', 'anderson'))); $allowed = array('percy'); $combined = array(); foreach ($arr as $k => $v) { if (is_array($v) { $combined[] = array_intersect_key($arr[$k], array_flip($allowed)); } } var_dump($combined);
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.20, 5.5.0 - 5.5.4
Parse error: syntax error, unexpected '{' in /in/eT9KM on line 10
Process exited with code 255.

preferences:
186.44 ms | 1387 KiB | 61 Q