#25494 [Opn->Csd]: array_merge allowing "false" as argument (silent when non-array is passed)
| From: | jay@php.net | Date: | Thu, 18 Sep 2003 19:06:08 +0000 |
| Subject: | #25494 [Opn->Csd]: array_merge allowing "false" as argument (silent when non-array is passed) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-47790@lists.php.net to get a copy of this message | ||
ID: 25494
Updated by: jay@php.net
Reported By: enygma at phpdeveloper dot org
-Status: Open
+Status: Closed
Bug Type: Arrays related
Operating System: Any
PHP Version: 4.3.2
New Comment:
It can't break BC if the behaviour was undocumented and
hence undefined. So either document the behaviour or fix
the bug.
Anybody relying on undocumented 'features' should know
they're at risk for having those behaviours changed.
J
Previous Comments:
------------------------------------------------------------------------
[2003-09-18 06:45:48] et@php.net
It's still inconsistent, and `will throw a warning and fail in 5 for
non-array arguments' will break BC without a need for it.
------------------------------------------------------------------------
[2003-09-18 06:08:03] sniper@php.net
Throwing an E_NOTICE error is not breaking anything.
------------------------------------------------------------------------
[2003-09-18 05:56:38] et@php.net
This `fix' is inconsistent with array_splice, which allows you to add
non-array arguments. (This is also documented.)
Also, this `fix' breaks BC. Is this really needed?
I'd rather have those functions convert non-array arguments into arrays
and then perform their operations like array_splice() does.
This has to be documented of course.
------------------------------------------------------------------------
[2003-09-11 13:57:55] jay@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
array_merge() throws E_NOTICEs now in 4.3.x and will throw
a warning and fail in 5 for non-array arguments.
J
------------------------------------------------------------------------
[2003-09-11 12:11:09] andrey@php.net
Jay, it's an undocumented feature. If it is not documented and obscure
it's developer's risk to use it. So, I think this is a bug and a check
for the input parameter should be performed. A warning throwed in the
same way as array_intersect() does will be the consistent way.
Opening again :)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/25494
--
Edit this bug report at http://bugs.php.net/?id=25494&edit=1