Re: Default argument values
| From: | Stephen Willcock | Date: | Mon, 17 Feb 2003 09:32:00 +0000 |
| Subject: | Re: Default argument values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135811@lists.php.net to get a copy of this message | ||
Yes, you can call your function with these arguments, but in this case of
course the defaults will not be used because you have supplied arguments.
SW
"Neko" <neko@swirve.com> wrote in message
news:Xns93255E4FBAC87scottnonononono@216.92.131.4...
> Hey All,
>
> I've been trying to write a function that accepts multiple optional
> parameters, some of which are ints. The function signature looks like
this:
>
> function blahBlah($fromDate, $toDate = 0, $limit = 20, $limitNodeType =
> null)
>
> I've been reading up here:
>
> http://www.php.net/manual/en/functions.arguments.php
>
> But it doesn't describe what to do with multiple optional arguments. Can I
> call the function like this:
>
> blahBlah($date, null, null, $limitNodeType);
>
>
> ?
>
> Need some help getting this language feature sorted.
>
> cheers,
> neko