Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80916 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9572 invoked from network); 20 Jan 2015 23:05:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2015 23:05:03 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.212.181 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:42837] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/0C-49046-3DEDEB45 for ; Tue, 20 Jan 2015 18:03:47 -0500 Received: by mail-wi0-f181.google.com with SMTP id fb4so15638552wid.2 for ; Tue, 20 Jan 2015 15:03:43 -0800 (PST) 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=f6+SuyVw3Zl7lioOdmUJjcJzZdEpcfLfcaUpnWvaEaQ=; b=OmtBqC3gzNpPIAXvi5dlJGaIILEhwaAGh0O2OZ0N4Y5KJzDayw/ogfZ+4OlW0YCPnE WME5d+475I5IfunhGa3FH9sj7YXPjvTQlFHXKHvNtnpbFrqDU5Y9qde53mVrWhFG0GYy rFUYd3hDhIAYZzLjASNLEL74gaYaOWvX1IYZyepMHL1d+XNBbC7hi0gm7EGMEYo4U1xt M/b5X/2p/5lzkTvqDFdu0NbSwj5vKHSleNurqi7xATU5Kig3MClJXpJ0ME5jfz3v/hJ+ Xz6SZSjmoapWGhj4s2hx1sOlkSeof2jG9XY7xzp0LtCUGIfaN/GRk2CZAGr+/AAqLxtv ZFaQ== X-Gm-Message-State: ALoCoQnCUqWtU7AvSB/ksbsrWx4nh+86iJhFMm+xxJd9P1HStFWmPNFsb4YBEf02ls6tRnNRKB5R MIME-Version: 1.0 X-Received: by 10.194.85.161 with SMTP id i1mr24995692wjz.35.1421795023295; Tue, 20 Jan 2015 15:03:43 -0800 (PST) Received: by 10.216.94.196 with HTTP; Tue, 20 Jan 2015 15:03:43 -0800 (PST) X-Originating-IP: [2.96.84.64] In-Reply-To: <54BEB604.9000705@mabe.berlin> References: <52243BA6.5040905@sugarcrm.com> <54B6C047.3070301@mabe.berlin> <48223964-2F90-4386-BD8F-934791E45EB4@welsh.co.nz> <9F083B4E-B603-4A1D-9F1D-C758D835B450@ajf.me> <54BEB604.9000705@mabe.berlin> Date: Tue, 20 Jan 2015 23:03:43 +0000 Message-ID: To: Marc Bennewitz Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Skipping parameters take 2 From: danack@basereality.com (Dan Ackroyd) On 20 January 2015 at 20:09, Marc Bennewitz wrote: > Pros & Cons > > _Named Parameters:_ > pro: > - readability (If caller is not required to call as assoc array) > - not an option for inheritance > con: > - paramter skipping is a side product with possible edge cases > - Adds variable names to be part of the API > - implementation complexity Nice summary, but I think "Adds variable names to be part of the API" is such a big thing it deserves two lines, as it would be horrible for things like anonymous functions or callbacks. e.g. 'second'); ?> Although named params sound like a nice idea, looking at how they would act in a large code base, it seems like they would be a source of unexpected issues, when people make assumptions about a function based on the argument names. People would probably have to mark libraries as safe to call via named params or not, which doesn't sound good. I'm pretty sure that parameter order is what actually defines a function's signature and so the 'default' placeholder is the only option that makes sense. cheers Dan