|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-21 08:42 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 11:00:01 2025 UTC |
Description: ------------ in php4 array_merge_recursive($arr1,$arr...) allowed the first array argument to be unassigned , in php5 it requires inintialising. perhaps php4 behaviour was a feature-bug ? Reproduce code: --------------- while( $whatever ){ $arr = foo->get_arr(); $tmp = array_merge_recursive( $tmp , $arr ) ; } Expected result: ---------------- $tmp is created if !exists & continues as expected Actual result: -------------- PHP-4.3.8 >> $tmp is created if !exists & continues as expected PHP-5.0.3 Warning: array_merge_recursive() Argument #1 is not an array in .... easily `solved` by initialising $tmp prior to use $tmp=array(); just unsure if this is intended ?