#30207 [Opn->Csd]: problem with func_get_args()

From: Date: Thu, 23 Sep 2004 18:15:57 +0000
Subject: #30207 [Opn->Csd]: problem with func_get_args()
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969364257@lists.php.net to get a copy of this message
ID: 30207 Updated by: sean@php.net Reported By: guth at fiifo dot u-psud dot fr -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Linux (mandrake 10) PHP Version: 5.0.1 -Assigned To: +Assigned To: sean 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: ------------------------------------------------------------------------ [2004-09-23 18:56:17] derick@php.net Correct, changing to documentation problem. ------------------------------------------------------------------------ [2004-09-23 15:06:06] guth at fiifo dot u-psud dot fr There is a documentation error then. "Returns an array in which each element is the corresponding member of the current user-defined function's argument list." doesn't mean "arguments passed to the function". For function haricow(), a list of arguments would be { $a, $b } ------------------------------------------------------------------------ [2004-09-23 14:55:29] derick@php.net No bug here, func_get_args() returns the arguments *passed* to the functoin. ------------------------------------------------------------------------ [2004-09-23 14:47:33] derick@php.net No bug here, func_get_args() returns the arguments *passed* to the functoin. ------------------------------------------------------------------------ [2004-09-23 13:49:32] guth at fiifo dot u-psud dot fr Description: ------------ (bad english...) There is a problem with functions func_[a-z]+_arg[s]?\(\). The problem can be a documentation error, a PHP bug, or a feature request (at your choice). I think that func_get_args() should return facultative arguments. So if it is not a bug, please transform this bug report in a Feature / Change request. It can also be an documentation fix. The actual behavior should be documented. Reproduce code: --------------- <?php function haricow($a, $b = 1) { echo func_num_args(); var_dump(func_get_args()); } haricow(1); Expected result: ---------------- 2 array(2) { [0] => int(1), [1] => int(1) } Actual result: -------------- 1 array(1) { [0] => int(1) } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30207&edit=1

« previous php.doc (#969364257) next »