From:             yippeei2 at nate dot com
Operating system: Windows XP/2003
PHP version:      4.3.4
PHP Bug Type:     Unknown/Other Function
Bug description:  mismatched a return value between func_num_args and 
count(func_get_args())

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)


-- 
Edit bug report at http://bugs.php.net/?id=27340&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27340&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27340&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27340&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27340&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27340&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27340&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27340&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27340&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27340&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27340&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27340&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27340&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27340&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27340&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27340&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27340&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27340&r=float

Reply via email to