Doc #62080 [Opn->Csd]: Vague/misleading example in call_user_func()
| From: | krakjoe@php.net | Date: | Sat, 01 Feb 2014 10:33:07 +0000 |
| Subject: | Doc #62080 [Opn->Csd]: Vague/misleading example in call_user_func() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10923@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62080&edit=1
ID: 62080
Updated by: krakjoe@php.net
Reported by: phplists at stanvassilev dot com
Summary: Vague/misleading example in call_user_func()
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: All
PHP Version: 5.3.13
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
This bug is reported for an unsupported version of PHP and is not connected to security.
It is therefore being closed.
If the bug is still present in a stable, supported version of PHP, please do open a new bug report.
Thanks for taking the time to help make PHP better :)
Previous Comments:
------------------------------------------------------------------------
[2012-05-20 18:58:27] phplists at stanvassilev dot com
Description:
------------
The doc page for call_user_func explains you can't pass arguments by reference
(CORRECT) using it, and instead offers this line using call_user_func_array():
"call_user_func_array('increment', array(&$a)); // You can use this instead
before
PHP 5.3"
This comment "You can use this instead before PHP 5.3" is misleading and
redundant. Nothing has changed in 5.3 regarding references in the arguments array.
This is not call-time pass by reference, it's references in an array. This code
work well in 5.2 & in 5.3, without errors/warnings.
This comment should be removed, the example is otherwise correct.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62080&edit=1