Re: problems with func_get_arg()
| From: | Chris Earle | Date: | Sat, 27 Jul 2002 04:59:27 +0000 |
| Subject: | Re: problems with func_get_arg() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109927@lists.php.net to get a copy of this message | ||
It must simply be a bug (probably confusing the function doTitle by calling
it, it might thinking you're requesting its info the second pass? Don't know
why, but it's a possibility)...
"James Nord" <teilo@cdt.luth.se> wrote in message
news:3D42184E.1070101@cdt.luth.se...
> 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
>
>
>