Re: Re: Named arguments revisited

From: Date: Thu, 12 Jan 2006 08:22:14 +0000
Subject: Re: Re: Named arguments revisited
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-21483@lists.php.net to get a copy of this message
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, ... ) { ... } Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.internals (#21483) next »