Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21483 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79000 invoked by uid 1010); 12 Jan 2006 08:20:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78985 invoked from network); 12 Jan 2006 08:20:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2006 08:20:32 -0000 X-Host-Fingerprint: 66.11.173.122 unknown Received: from ([66.11.173.122:63226] helo=interjinn.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F2/48-29075-F4116C34 for ; Thu, 12 Jan 2006 03:20:31 -0500 Received: from blobule.suds (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id 1C35311FB69; Thu, 12 Jan 2006 03:20:25 -0500 (EST) To: Jason Garber Cc: Aidan Lister , internals@lists.php.net In-Reply-To: <157554660.20060112012542@ionzoft.com> References: <56.50.29075.176B5C34@pb1.pair.com> <157554660.20060112012542@ionzoft.com> Content-Type: text/plain Organization: InterJinn Message-ID: <1137054133.23509.4.camel@blobule.suds> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5-4mdk Date: Thu, 12 Jan 2006 03:22:14 -0500 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Named arguments revisited From: robert@interjinn.com (Robert Cummings) 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. | `------------------------------------------------------------'