From: ondrej at sury dot org
Operating system: Linux
PHP version: 4.4.0
PHP Bug Type: Scripting Engine problem
Bug description: func_get_arg() can not be used more than once in function
calls
Description:
------------
func_get_arg() can be used as argument to function only once.
Reproduce code:
---------------
<?php
function doTitle($a = NULL, $b = NULL) {
print "doTitle: $a, $b\n";
}
function doHead() {
doTitle(func_get_arg(0));
doTitle(func_get_arg(1));
doTitle(func_get_arg(0), "3");
doTitle(func_get_arg(0), func_get_arg(1));
}
doHead("1", "2");
?>
Expected result:
----------------
doTitle: 1,
doTitle: 2,
doTitle: 1, 3
doTitle: 1, 2
Actual result:
--------------
doTitle: 1,
doTitle: 2,
doTitle: 1, 3
Fatal error: func_get_arg(): Can't be used as a function parameter in
/tmp/func_get_arg.php on line 11
--
Edit bug report at http://bugs.php.net/?id=34120&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34120&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34120&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34120&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34120&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34120&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34120&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34120&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34120&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34120&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34120&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34120&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34120&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34120&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34120&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34120&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34120&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34120&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34120&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34120&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34120&r=mysqlcfg