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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to