17 Jan
2006
17 Jan
'06
4:52 p.m.
+= is not array_merge. array_merge overwrites keys that are the same while += does not overwrite. (now, that I read PHP source code, I know that $a += $a; for arrays is nicely optimized: the add function immediately returns and does iterate / copy etc the whole array needlessly.) In short: no, because
$form['foo'] = array('a' => 'b', 'c' => 'd'); $form['foo'] += array('a' => 'new b', 'e' => 'f');
would result in array('a' => 'b', 'c' => 'd', 'e' => 'f'); Regards NK