#31216 [Opn->Bgs]: array_merge_recursive change in behaviour php4>5
| From: | derick@php.net | Date: | Tue, 21 Dec 2004 07:42:45 +0000 |
| Subject: | #31216 [Opn->Bgs]: array_merge_recursive change in behaviour php4>5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-70800@lists.php.net to get a copy of this message | ||
ID: 31216
Updated by: derick@php.net
Reported By: fire at firepages dot com dot au
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: win32 XP SP1
PHP Version: 5.0.3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Read the migration part in the PHP Manual.
Previous Comments:
------------------------------------------------------------------------
[2004-12-21 04:25:01] fire at firepages dot com dot au
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 ?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31216&edit=1