Doc #65894 [Opn]: array_reduce documentation: callback has parameter by reference
| From: | inefedor at gmail dot com | Date: | Mon, 14 Oct 2013 14:47:11 +0000 |
| Subject: | Doc #65894 [Opn]: array_reduce documentation: callback has parameter by reference | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10489@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65894&edit=1
ID: 65894
User updated by: inefedor at gmail dot com
Reported by: inefedor at gmail dot com
Summary: array_reduce documentation: callback has parameter
by reference
Status: Open
Type: Documentation Problem
Package: Arrays related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
[typo] ...like one supposed to STORE result in this variable...
Previous Comments:
------------------------------------------------------------------------
[2013-10-14 14:45:51] inefedor at gmail dot com
Description:
------------
Hi,
In the documentation on array_reduce function ( http://php.net/manual/ru/function.array-reduce.php
) there's callback in the parameters list and it is defined like so "mixed callback (
mixed &$result , mixed $item )".
The $result parameter, for some reason, is being received by reference. But it doesn't make any
sense, does it? This variable is destroyed right after zend_call_function call was made.
I know, it might seem like pretty minor bug, but it confused me (and my colleagues) so many times.
It may seem like one supposed to result in this variable instead of returning it, so there lays a
confusion...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65894&edit=1