Re: How can I use a function's default arguments but change one of the end ones in the list?
| From: | Shawn McKenzie | Date: | Fri, 06 Feb 2009 01:25:54 +0000 |
| Subject: | Re: How can I use a function's default arguments but change one of the end ones in the list? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-287785@lists.php.net to get a copy of this message | ||
German Geek wrote:
> I've thought about this problem before but couldn't think of a solution
> either. How does func_get_args() solve this? You could make a wrapper
> function without that.
>
> How would u (php) know which parameter u mean in a particular case?
>
> I think it would just be useful to have an IDE that can write out the
> default parameters on a keyboard shortcut or mouse click and then u can
> change them afterwards.
>
> Cheers,
> Tim
>
> Tim-Hinnerk Heuer
>
> http://www.ihostnz.com
>
Well, using func_get_args() you can pass whatever you want and parse the
args to see what was passed and assign default values if a specific arg
wasn't passed.
I however would probably pass an associative array to the func and parse
that.
--
Thanks!
-Shawn
http://www.spidean.com