Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21484 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86452 invoked by uid 1010); 12 Jan 2006 08:58:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86437 invoked from network); 12 Jan 2006 08:58:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2006 08:58:17 -0000 X-Host-Fingerprint: 64.233.184.202 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.202:31282] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F6/A8-29075-82A16C34 for ; Thu, 12 Jan 2006 03:58:17 -0500 Received: by wproxy.gmail.com with SMTP id i6so328486wra for ; Thu, 12 Jan 2006 00:58:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=X2JAI2P7D0m4eIrVRHh4XRzfTQPEaTIpuAvoqVtmO5rVxdDddwUu9UpdcdTNGXHlY7EF7dMzak6Us8QDcX2kWg7VHHo62k6TuyWHNzMK3cXp4NWWsG7nD8dHzRIhON6+LR60FH8l+44gour+viUhsVK5QnrbxtLQSug6leYHpao= Received: by 10.65.205.7 with SMTP id h7mr587225qbq; Thu, 12 Jan 2006 00:58:13 -0800 (PST) Received: by 10.65.254.5 with HTTP; Thu, 12 Jan 2006 00:58:13 -0800 (PST) Message-ID: <877e9a170601120058v67ff4457md20576f3e91360e9@mail.gmail.com> Date: Thu, 12 Jan 2006 09:58:13 +0100 To: Robert Cummings Cc: Jason Garber , Aidan Lister , internals@lists.php.net In-Reply-To: <1137054133.23509.4.camel@blobule.suds> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <56.50.29075.176B5C34@pb1.pair.com> <157554660.20060112012542@ionzoft.com> <1137054133.23509.4.camel@blobule.suds> Subject: Re: [PHP-DEV] Re: Named arguments revisited From: michael.walter@gmail.com (Michael Walter) On 1/12/06, Robert Cummings 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=3DNULL, $needle=3DNULL, $strip_links=3DNULL,= ...) > > { > > is_null($text) && $text =3D SOME DEFAULT VALUE; > > is_null($needle) && $text =3D SOME DEFAULT VALUE; > > is_null($strip_links) && $text =3D SOME DEFAULT VALUE; > > ... > > } > > Ummmmm, how is that different (ignoring the copy paste bugs in the && > $text parts) than: > > function highlight > ( > $text=3DSOME DEFAULT VALUE, > $needle=3DSOME DEFAULT VALUE, > $strip_links=3DSOME DEFAULT VALUE, > ... > ) > { > ... > } > To quote Jason, "In [the] way, [that] the user doesn't have to remember the default values, just the offsets.". Michael