Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68920 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39909 invoked from network); 6 Sep 2013 18:11:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Sep 2013 18:11:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 74.125.82.47 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 74.125.82.47 mail-wg0-f47.google.com Received: from [74.125.82.47] ([74.125.82.47:46585] helo=mail-wg0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/B6-05619-6DA1A225 for ; Fri, 06 Sep 2013 14:11:34 -0400 Received: by mail-wg0-f47.google.com with SMTP id f12so3301563wgh.14 for ; Fri, 06 Sep 2013 11:11:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kcm0gdSU2ROenodS2BM0LBZgj8KgfM2Sx0Tx1Q0cDBE=; b=kSJpyBwpkBZQhqpD6mRSvik2Ck5POY9WXV1MpkuPvQZv4AfZuzatbgSOgeW2sVwoHw BRCe5y7Cm7JvPUWmIUvwRdcoedt4N7potQL+1S3hCD7kSR7lVZCQdnDBcJrwkL+79SJ4 lyPq3D5w5riD/QTR6jGvZ1rI353g5UsEHWRnDoeeNGFQXHzJe6JI7FrjDdtjFODdpOY2 Dxd4nLJe30FJTrWbHNzJXV0FS7vYEY0ZB0l5gu0SLKptiMIxH9ziQlYwyRBXIqO1wnY+ 9FFX3VoQ7orC46QyebYiEMe7I2vlwSpkQwzz8NDdxBL1z97j1VVFuq0H4b6O+yPRJdJl fHYw== X-Gm-Message-State: ALoCoQmp54UdYO+ME6x+p38MRF7IljtImN4I45CAdoRGyj6mFJik97odw0yyIDoOgMKJIy+dN6Mi MIME-Version: 1.0 X-Received: by 10.180.89.101 with SMTP id bn5mr11403771wib.39.1378491091474; Fri, 06 Sep 2013 11:11:31 -0700 (PDT) Received: by 10.217.10.73 with HTTP; Fri, 6 Sep 2013 11:11:31 -0700 (PDT) X-Originating-IP: [78.149.7.155] In-Reply-To: References: Date: Fri, 6 Sep 2013 19:11:31 +0100 Message-ID: To: George Bond Cc: PHP internals Content-Type: multipart/alternative; boundary=f46d0444eba3d66b7c04e5baf7de Subject: Re: [PHP-DEV] [RFC] Named parameters From: danack@basereality.com (Dan Ackroyd) --f46d0444eba3d66b7c04e5baf7de Content-Type: text/plain; charset=ISO-8859-1 George Bond wrote: > Then the double-dollar syntax would seem the obvious choice to me: > foo( $$param => 'whatever' ); > Which is no less readable than anywhere else the double-dollar is > allowed... :-p For the simple case I agree having double $$ signs is not that bad, but it would get nasty for anything other than a simple variable. e.g. if the param name was in an array: $searchKeys[] = 'firstParameter' $searchValues[] = 25; foo( ${$searchKeys[0]} => $searchValues[0] ); which is definitely less legible than: foo( $searchKeys[0] => $searchValues[0] ); cheers Dan On Fri, Sep 6, 2013 at 6:44 PM, George Bond wrote: > Regarding variable parameter names; if the syntax was: > > function foo( $firstParameter ) { ... } > foo( $firstParameter=> 'foo' ); > > Then the double-dollar syntax would seem the obvious choice to me: > > function foo( $firstParameter ) { ... } > $param = 'firstParameter'; > foo( $$param => 'whatever' ); > > Which is no less readable than anywhere else the double-dollar is > allowed... :-p > > --G > --f46d0444eba3d66b7c04e5baf7de--