Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85037 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91257 invoked from network); 16 Mar 2015 12:10:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 12:10:53 -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 209.85.213.47 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.213.47 mail-yh0-f47.google.com Received: from [209.85.213.47] ([209.85.213.47:35017] helo=mail-yh0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/74-03331-D48C6055 for ; Mon, 16 Mar 2015 07:10:53 -0500 Received: by yhct68 with SMTP id t68so16637696yhc.2 for ; Mon, 16 Mar 2015 05:10:50 -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=B0SAhO+JD0cIp+f7wxBPlvzpcHAN7eyGK6/+v4ap57A=; b=PdhGkA3nVAS0PN5JYBokSno3R1SmnZ1Y8TN9mJYs+/pxDZ5Y3RwhLJQQs9pr6gp0U+ lmxRvt8J8WS2NrGZ78GztJalqZs3W6qWm2elGmZXSTVGdWcuRNGHssdw0JJQcSdu5GMQ hfHCqHVq79WMy9HkoGdY0JbOukcaTxXlc6niV/PZensybM2wQZnV+Iq/CInfs4do75im +TW4idMonYZhxmhWUzrbCQk/dRiGO2TxL1AyXyx4g55Z7BILETFrderLSnDQqQkiEtA7 GJi8I1IvXlZZPYeY2SI0md+Jv/dTu3Inw9JJB2bpTDWGLvBrA4X4yeWZ7OGsoUvSgxs5 XDKw== X-Gm-Message-State: ALoCoQnH7X1NvSHU531W5E5uKw3rMBOejouo15Ss1KC4ytW+9+Lf0Bw0ZJ+TyPPJK1uCPtgH81EX MIME-Version: 1.0 X-Received: by 10.170.202.7 with SMTP id t7mr68870249yke.13.1426507849309; Mon, 16 Mar 2015 05:10:49 -0700 (PDT) Received: by 10.170.71.86 with HTTP; Mon, 16 Mar 2015 05:10:49 -0700 (PDT) X-Originating-IP: [78.147.4.32] In-Reply-To: References: Date: Mon, 16 Mar 2015 12:10:49 +0000 Message-ID: To: marcio3w@gmail.com Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV][RFC][VOTE][RESTART] Strict Argument Count On Function Calls From: danack@basereality.com (Dan Ackroyd) On 16 March 2015 at 02:31, Marcio Almada wrote: > There was no need to update the BC break section. The only minor change was > the addition of the following section: > Yeah, really strong -1 on this one, even after the modification. Now that the RFC only covers static calling, all of the code it would pickup could be easily found with a static code analysis tool. For people who use those already, this RFC has zero benefits and only downsides. Having the behaviour of the language change depending on whether `func_get_args` is in the body of the function is really pretty weird. Similarly having the behaviour change based on how it's called is nuts. function foo() { ... } $fn = 'foo'; $fn(1); //works foo(1); //breaks; If this RFC does pass, it will be an instant addition to phpsadness.com. Also, the RFC talks a lot about BC breaks but it doesn't even consider Forward Compatibility. Imagine I have a library that other people use with a `function foo($x) {}` I can add other parameters to that function without breaking any code by using a parameter with a default value i.e. `function foo($x, $y = null) {}` Currently, I can also remove the parameter to make the function signature be `function foo($x) {}` without anything breaking. This means that people can run their code both against the current version of the library and the next one, which allows them to test a new version of a library without having to modify their code, so are still able to run the current version. As Marco said, even if it's possible to 'fix' the code that uses this behaviour - it's a really really useful pattern in the rare case where it's needed. cheers Dan