problems with func_get_arg()
| From: | James Nord | Date: | Sat, 27 Jul 2002 03:49:34 +0000 |
| Subject: | problems with func_get_arg() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-109920@lists.php.net to get a copy of this message | ||
Hi,
Using the following code snippet
function doHead() {
header("Last-Modified: " . gmdate("D, d M Y H:i:s", getlastmod()) . " GMT");
if (func_num_args() == 2) {
doTitle(func_get_arg(0), func_get_arg(1));
}
else {
doTitle(func_get_arg(0));
}
if I pass 2 argument into the function then I get the following error
*
Fatal error*: func_get_arg(): Can't be used as a function parameter
but passing 1 argument is ok as is using the following code with 2 arguments
function doHead() {
header("Last-Modified: " . gmdate("D, d M Y H:i:s", getlastmod()) . " GMT");
if (func_num_args() == 2) {
$a = func_get_arg(0);
$b = func_get_arg(1);
doTitle($a, $b);
}
else {
doTitle(func_get_arg(0));
}
Is there a particualr reason for this or is it a bug? PHP/4.1.2 on Debian Stable (PowerPC)
/James
--
Technology is a word that describes something that doesn't work yet.
Douglas Adams