#31643 [Opn->Bgs]: new array_merge behavior is inconsistent with other functions and PHP's spirit.
| From: | derick@php.net | Date: | Fri, 21 Jan 2005 19:46:40 +0000 |
| Subject: | #31643 [Opn->Bgs]: new array_merge behavior is inconsistent with other functions and PHP's spirit. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72615@lists.php.net to get a copy of this message | ||
ID: 31643
Updated by: derick@php.net
Reported By: mkimsal at conduit-it dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Linux
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
This is a deliberate break and we're not going to change it back.
Previous Comments:
------------------------------------------------------------------------
[2005-01-21 19:11:09] mkimsal at conduit-it dot com
Description:
------------
This creates a need to define variables before being used
which is opposite of PHP's original behavior and spirit.
This strange array_merge behavior is one step closer to
making PHP a strongly typed language if the function
behaves differently depending on whether or not aruments
are defined and empty or not defined at all.
Reproduce code:
---------------
$array2 = array('a');
$empty_var = array_merge($array1,$array2);
Expected result:
----------------
$empty_var should be an array with the same contents as
array2.
Actual result:
--------------
$empty_var contains no data at all. This is different
from PHP4 behavior with no benefits.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31643&edit=1