Doc #51453 [Opn->Csd]: Mentioning NULL as special value for replacement in array_splice()
| From: | degeberg@php.net | Date: | Thu, 01 Apr 2010 20:33:25 +0000 |
| Subject: | Doc #51453 [Opn->Csd]: Mentioning NULL as special value for replacement in array_splice() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4143@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51453&edit=1
ID: 51453
Updated by: degeberg@php.net
Reported by: news_yodpeirs at thoftware dot de
Summary: Mentioning NULL as special value for replacement in
array_splice()
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: degeberg
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2010-04-01 22:33:20] degeberg@php.net
Automatic comment from SVN on behalf of degeberg
Revision: http://svn.php.net/viewvc/?view=revision&revision=297304
Log: Fixed #51453 (Mentioning NULL as special value for replacement in
array_splice())
------------------------------------------------------------------------
[2010-04-01 11:22:18] news_yodpeirs at thoftware dot de
Description:
------------
Documentation of array_splice() should mention NULL as a special value
for replacement (just as objects) as typecasting NULL into an array
results in an empty array.
If you want the splicing to create a new element with value NULL you
have to use "array(NULL)" instead of NULL.
You should expect this if you read the explanation carefully (and if you
know about typecasting NULL as array), but just as objects are
considered as a special case for replacement, NULL should be too.
The explanation of replacement better should read: "If replacement is
just one element it is not necessary to put array() around it, unless
the element is an array itself, an object or NULL."
And the note better should be: "If replacement is not an array, it will
be typecast to one (i.e. (array) $parameter). This may result in
unexpected behavior when using an object or NULL replacement."
jmtc
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51453&edit=1