Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68990 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50752 invoked from network); 10 Sep 2013 10:19:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2013 10:19:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.213.43 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.213.43 mail-yh0-f43.google.com Received: from [209.85.213.43] ([209.85.213.43:39243] helo=mail-yh0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/75-03199-D32FE225 for ; Tue, 10 Sep 2013 06:19:42 -0400 Received: by mail-yh0-f43.google.com with SMTP id b6so2814326yha.30 for ; Tue, 10 Sep 2013 03:19:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=VGW03rJrnQWQ4EacShqy9veb6MIHdeUq3Hg7pSRbD8w=; b=dkIAkxFQhH67HEuYlKMdi19sy+pnqXP/bK7lIWs3ixTW9tslWk+/CnINMPvRXYsBHA nFg/5daNl/i3KblI3NVY0RQ+L6riZiqPKFGc/ye1txrVpcRav+Cs5QDO68szF0k0LpQP Ne84fjpM9s5CQYOhndUZIRYTCr3QSaNruG6IY8mhLbaOeJmQaN4WIrBY/VJaan3vJ31Y KedZliAI2LCzy4YA2j2Sa7GnXYG/P1kd1+oZuA2TX2HeQQFpNZcRbTADADlZB1ew3Ote t3ll0BewusUJYvt64gSyi3kjUS6u1jBUaCFJf8iu7htueDjwOqQKUlNA+Ty/CuZXXrUL 5hWw== X-Gm-Message-State: ALoCoQm1bbfXnYPQpA7r57dCx849Cfy7TGLXGqOwS0lVdS7uU7jApG/XJvp6cmaqkbOubtRdhaSv X-Received: by 10.236.38.162 with SMTP id a22mr21369387yhb.30.1378808378293; Tue, 10 Sep 2013 03:19:38 -0700 (PDT) Received: from [192.168.1.2] (53.sub-70-192-131.myvzw.com. [70.192.131.53]) by mx.google.com with ESMTPSA id u66sm23716225yhd.24.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 03:19:37 -0700 (PDT) Message-ID: <522EF22F.1040006@lerdorf.com> Date: Tue, 10 Sep 2013 12:19:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Nikita Popov CC: Daniel Macedo , PHP internals References: In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Named parameters From: rasmus@lerdorf.com (Rasmus Lerdorf) On 09/10/2013 12:27 AM, Nikita Popov wrote: > Yes, throwing an error during the signature validation is the "right" thing > to do from a theoretic point of view. The issue is just that it breaks old > code which didn't make sure that parameter names between parent and child > lined up. "Break" is a bit too much here as it would still run, just > throwing an E_STRICT. This is what I'd like to go for, but others disagree > so I tried to offer an alternative solution. It isn't feasible to suddenly start spewing E_STRICT errors on inherited methods that change the name of the parent's arguments. The name of the arguments has never mattered before and tons of code will no longer be E_STRICT clean even if they don't use named parameters. I think you are over-thinking this case actually. I would prefer to just keep it simple. If someone does a named parameter call to a method that doesn't have a parameter with a specified parameter it is an error, regardless of how that came to be. If there is a parent method with the parameter name, it doesn't matter since that is not the method they are calling. Just keep it simple and generate an error just on that call. The fix for the user in this case may very well be to go and make the parameter names match the parent method, but let them worry about that. -Rasmus