Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68855 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83152 invoked from network); 2 Sep 2013 17:24:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2013 17:24:13 -0000 Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.42 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.219.42 mail-oa0-f42.google.com Received: from [209.85.219.42] ([209.85.219.42:51234] helo=mail-oa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/3A-29856-DB9C4225 for ; Mon, 02 Sep 2013 13:24:13 -0400 Received: by mail-oa0-f42.google.com with SMTP id n12so1542627oag.29 for ; Mon, 02 Sep 2013 10:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=GrCFb8vgU8IhWSsPW6aGu4eoQ+dletm9CJRyoduG1tw=; b=e/HnTISoer1UAhFhmqhxbuQhz98F6W6m8fh3V6qfmIHPrvyjUt5Ekwmvyj3wEtJQa+ Th/oFyjQJb3L6G14f5HtFPTh260hwKV1Xf5+e9+cD3TtHNSTLJ1PoGmQ531eqHNOZHyl Wy4B01aqpRKXkr5fVmWDeU6WuRfyYyylQACHuokzGC3l2R6yoE62uTnI56DDlrrRyoQq CXJS98C97P3ZS4At5CiQquGfPY8JNP4tHfoHBuHiaA0Bi4FN9DdcgosZ+1ixkcz5+fo2 0d5MXJQtIOVMxhZgpc1A81TPVR/ynW3/BvputYnQhLgSaM0itgrsuwXnui+JSBJTkoRy Ogaw== X-Received: by 10.60.124.14 with SMTP id me14mr17697024oeb.4.1378142649959; Mon, 02 Sep 2013 10:24:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.100.6 with HTTP; Mon, 2 Sep 2013 10:23:48 -0700 (PDT) In-Reply-To: References: <52243BA6.5040905@sugarcrm.com> Date: Mon, 2 Sep 2013 19:23:48 +0200 Message-ID: To: "jbondc@openmv.com" Cc: Sebastian Krebs , Pierre Joye , Stas Malyshev , PHP Internals Content-Type: multipart/alternative; boundary=047d7b5d33d419cb7c04e569d747 Subject: Re: [PHP-DEV] [RFC] Skipping parameters take 2 From: linepogl@gmail.com (Lazare Inepologlou) --047d7b5d33d419cb7c04e569d747 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2013/9/2 jbondc@openmv.com > On Mon Sep 2 08:52 AM, Sebastian Krebs wrote: > > 2013/9/2 Pierre Joye > > > > > > > > > > Any comments or feedback on the RFCs and the code are welcome, > > > > especially pointing out the cases where it may not work (which mean= s > > > > we need more phpt's there :) > > > > > > Using default instead of ,,, is indeed much more readable. > > > > > > However I still wonder what prevents to finally implement named > > > parameters too, it will provide the same feature while being even mor= e > > > handy and easier. > > > > > > And it covers an additional use-case: Self-explaning parameters like in > > "foo(is_strict =3D false)" instead of "foo(null, null, false)". > > > > > > Lots of overlap between variadic functions, this proposal & named > parameters. > > I don't think that variadic functions prevent any of the other two, or that they are used for the same cases. > interface foo { > function formatUseCases(...$options); > } > - Advantage: No dependency on a class / object > - Disadvantage: doesn't document what options are available, no default > parameters > This is totally not a use case for variadic functions. The arguments of a variadic function are indexed, not named. In addition, they have the same type (or at least they are treated the same way). Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel --047d7b5d33d419cb7c04e569d747--