|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-23 13:49 UTC] 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) }
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 16:00:01 2025 UTC |
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 }