#31216 [NEW]: array_merge_recursive change in behaviour php4>5
| From: | fire at firepages dot com dot au | Date: | Tue, 21 Dec 2004 03:25:02 +0000 |
| Subject: | #31216 [NEW]: array_merge_recursive change in behaviour php4>5 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-70760@lists.php.net to get a copy of this message | ||
From: fire at firepages dot com dot au
Operating system: win32 XP SP1
PHP version: 5.0.3
PHP Bug Type: Zend Engine 2 problem
Bug description: array_merge_recursive change in behaviour php4>5
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 bug report at http://bugs.php.net/?id=31216&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31216&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31216&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31216&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31216&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31216&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31216&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31216&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31216&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31216&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31216&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=31216&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=31216&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31216&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31216&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31216&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31216&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31216&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31216&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31216&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31216&r=mysqlcfg