Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47849 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60224 invoked from network); 9 Apr 2010 21:01:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2010 21:01:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 188.40.37.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 188.40.37.16 hq1.backendmedia.com Linux 2.6 Received: from [188.40.37.16] ([188.40.37.16:52617] helo=hq1.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/76-54833-9A59FBB4 for ; Fri, 09 Apr 2010 17:01:30 -0400 Received: from localhost (unknown [127.0.0.1]) by hq1.backendmedia.com (Postfix) with ESMTP id 75F922E30008; Fri, 9 Apr 2010 21:01:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from hq1.backendmedia.com ([127.0.0.1]) by localhost (hq1.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JJOCHetDBRnY; Fri, 9 Apr 2010 23:01:25 +0200 (CEST) Received: from [192.168.0.151] (217-162-131-234.dclient.hispeed.ch [217.162.131.234]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by hq1.backendmedia.com (Postfix) with ESMTPSA id C9E392E30004; Fri, 9 Apr 2010 23:01:24 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii In-Reply-To: <4BBC93A6.6010806@cschneid.com> Date: Fri, 9 Apr 2010 23:01:25 +0200 Cc: Tjerk Anne Meesters , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <745C5243-EB51-4D43-B036-8A34CDBBB547@gregory.net> <4BB68D61.2070301@lerdorf.com> <4BB6938F.7090404@zend.com> <4BB90DB7.6060706@zend.com> <4BBC25DD.7060604@divbyzero.net> <4BBC93A6.6010806@cschneid.com> To: Christian Schneider X-Mailer: Apple Mail (2.1078) Subject: Re: [PHP-DEV] Named Parameters From: mls@pooteeweet.org (Lukas Kahwe Smith) On 07.04.2010, at 16:16, Christian Schneider wrote: my gut feeling also says that we shouldnt allow positional arguments = after named parameters. just picking out one of your examples ..=20 > foreach (new T_User('firstname' =3D> $firstname, "ORDER BY age") as = $user) couldnt this also be written as: foreach (new T_User('firstname' =3D> $firstname, "ORDERBY" =3D> "age") = as $user) of course it would be a bit more work when constructing the final query, = but its tons clearer in terms of knowing how to use the API with just = reading one use of the API and not the actual implementation. in the above code what is the purpose of the positional argument? can i = just "append" what I want? aka is the idea of the API to also support foreach (new T_User('firstname' =3D> $firstname, "LIMIT 100") as $user) and foreach (new T_User('firstname' =3D> $firstname, "ORDER BY age LIMIT = 100") as $user) in that case it would still be better to then do: foreach (new T_User('firstname' =3D> $firstname, 'append' =3D> "ORDER BY = age") as $user) .. of course its a few more characters, but its definitely easier to = grasp whats going on, then having to parse what is named and what is = positional. ---- i am trying to remember what killed the discussion last time around. i = think it was concerns over having to convert all internal functions, but = i guess that was before we unified the parameter parsing API. IIRC = hartmut was quite involved in the discussion back then .. maybe he = remembers. regards, Lukas Kahwe Smith mls@pooteeweet.org