note 72105 deleted from function.func-get-arg by bobby
| From: | bobby@php.net | Date: | Wed, 03 Jan 2007 15:23:35 +0000 |
| Subject: | note 72105 deleted from function.func-get-arg by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121252@lists.php.net to get a copy of this message | ||
Note Submitter: Stephen
----
Re: anders at ingemann dot fakestuff dot de
In your first post, you suggest that this is a good way of avoiding having to pass values that
should stay at their default values, i.e. only passing what you need.
However, while that is an inconvenience, I think that it is still not as inconvenient as the
typechecking solution you came up with, especially considering that most functions are liable to
receive multiple arguments of the same type. This is further complicated by the fact that PHP is
dynamically, not statically, typed, which is another thing you have to look out for.
Personally the only need I see for variable numbers of arguments is if you are passing multiple
arguments, each of which should be acted on in serial in the same way. e.g. if you wrote a function
custom_remove_html_tags() and had it accept a list of strings as reference that it should correct.
Even then, the only benefit is that it saves you from having to create an array.
Overall, I think this function is probably not worth using.