Bug->Doc #52778 [Opn->Bgs]: array_walk() doc contradicts itself
| From: | cataphract@php.net | Date: | Sun, 05 Sep 2010 03:34:45 +0000 |
| Subject: | Bug->Doc #52778 [Opn->Bgs]: array_walk() doc contradicts itself | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4974@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52778&edit=1
ID: 52778
Updated by: cataphract@php.net
Reported by: daniel at danielnorton dot com
Summary: array_walk() doc contradicts itself
-Status: Open
+Status: Bogus
-Type: Bug
+Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.3
Block user comment: N
New Comment:
You're not reading the whole phrase. It says "Users may not change the
array itself from the callback function. e.g. Add/delete elements, unset
elements, etc.". It does not contradict the note before. The note before
is about changing the array data (the values), what's not possible is to
change the array itself (i.e., its structure).
Previous Comments:
------------------------------------------------------------------------
[2010-09-05 01:53:44] daniel at danielnorton dot com
Description:
------------
Here:
http://php.net/manual/en/function.array-walk.php
For the funcname parameter it mentions in a note box that specifying a
parameter
as a reference can be useful because "any changes made to those elements
will be
made in the original array itself". After the box, the description of
the
parameter continues with a contradictory warning: "Users may not change
the array
itself from the callback function."
Specifying a reference is useful to save memory for large arrays, but
the reason
given is wrong and misleading.
You should also probably take the opportunity to clarify that the
reference must
be in the callback function formal parameter list and not the actual
parameter
list of the invocation, as the latter is deprecated in PHP 5.3.0.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52778&edit=1