Doc #62080 [ReO->Csd]: Vague/misleading example in call_user_func()

From: Date: Mon, 17 Nov 2014 20:48:33 +0000
Subject: Doc #62080 [ReO->Csd]: Vague/misleading example in call_user_func()
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11648@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: salathe@php.net Reported by: phplists at stanvassilev dot com Summary: Vague/misleading example in call_user_func() -Status: Re-Opened +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: All PHP Version: 5.3.13 -Assigned To: +Assigned To: salathe Block user comment: N Private report: N 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. Fixed by removing "before PHP 5.3" from the comment (and putting it above the line of code for readability). Previous Comments: ------------------------------------------------------------------------ [2014-11-17 20:47:36] salathe@php.net Automatic comment from SVN on behalf of salathe Revision: http://svn.php.net/viewvc/?view=revision&revision=335189 Log: fixed comment in example of call_user_func with array (doc bug #62080) ------------------------------------------------------------------------ [2014-02-01 13:29:59] salathe@php.net The documentation could do with being improved, as mentioned in the original report. ------------------------------------------------------------------------ [2014-02-01 10:33:06] krakjoe@php.net 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 :) ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#11648) next »