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()) + $config_data; $config_data['boolean'] = array(); echo var_dump($config_data); $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 nGoaj
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.4.14, 5.4.16 - 7.2.0
array(4) { ["new_key"]=> string(9) "new_value" ["new_array"]=> array(0) { } [0]=> array(0) { } ["boolean"]=> array(0) { } }
Output for 5.4.15

Process exited with code 137.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/4vQ8W on line 12
Process exited with code 255.