|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-21 03:07 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 01:00:01 2025 UTC |
Description: ------------ func_num_args is return a value arguments count. count(func_get_args()) is same as func_num_args. but when certain function has two arguments, an below result mismatched between func_num_args and count(func_get_args()). when numbers of arguments are 2, this bug is caused. above bug is caused on PHP5.0b4 too. Reproduce code: --------------- <?php function certain_func(){ $args = func_get_args(); $argsCount = func_num_args(); echo "func_num_args() returns $argsCount\n"; echo "count(func_get_args()) returns ".count($args)."\n"; echo "below list is an item of \$args :\n"; print_r($args); echo "\n"; } certain_func('one', 'two'); certain_func('one', 'two', 'three'); ?> Expected result: ---------------- func_num_args() returns 2 count(func_get_args()) retruns 3 below list is an item of $args : Array ( [0] => one [1] => two [2] => ) func_num_args() returns 3 count(func_get_args()) retruns 3 below list is an item of $args : Array ( [0] => one [1] => two [2] => three)