3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $config_data = array(array(), 'boolean' => TRUE); $config_data = array('new_key' => 'new_value', 'new_array' => array(), 'int' => 2) + $config_data; $config_data['boolean'] = array(); $errors = array(); $i = 0; $config_data = array('new_key' => 'new_value', 'new_array' => array(), 'boolean' => array()); foreach ($config_data as $key => $value) { $errors = array_merge($errors, array($key => $value)); } echo var_dump($errors);
based on RgcNE
Output for 4.3.0 - 7.2.0
array(3) { ["new_key"]=> string(9) "new_value" ["new_array"]=> array(0) { } ["boolean"]=> array(0) { } }