On 1/12/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Thu, 2006-01-12 at 01:25, Jason Garber wrote:
> > Hello Aidan,
> >
> > I think named parameters would be a useful feature... I'll leave it
> > at that.
> >
> > Here is a coding idea for you, in case you hadn't considered it...
> >
> > function highlight($text=NULL, $needle=NULL, $strip_links=NULL, ...)
> > {
> > is_null($text) && $text = SOME DEFAULT VALUE;
> > is_null($needle) && $text = SOME DEFAULT VALUE;
> > is_null($strip_links) && $text = SOME DEFAULT VALUE;
> > ...
> > }
>
> Ummmmm, how is that different (ignoring the copy paste bugs in the &&
> $text parts) than:
>
> function highlight
> (
> $text=SOME DEFAULT VALUE,
> $needle=SOME DEFAULT VALUE,
> $strip_links=SOME DEFAULT VALUE,
> ...
> )
> {
> ...
> }
>
To quote Jason, "In [the] way, [that] the user doesn't have to
remember the default values,
just the offsets.".
Michael
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php