On 28/10/2020 17:06, Michael Voříšek - ČVUT FEL wrote:
For better names, I propose to allow rename "to never used name", thus
position is never changed and everything behave consistently across
named/unnamed params. I also propose to accept the old names, as
currently, if not used with the new names, the parameter names are not
resolved, so OOP/LSP is violated.


This is precisely the behaviour discussed as an alternative in the RFC: https://wiki.php.net/rfc/named_params#to_parameter_name_changes_during_inheritance

The reasons it was not implemented are given at the end of that section.


Significant additional code in the engine to perform additional checks and/or name aliasing

I know, but we can do very easily one thing - check and throw if
overriding method has one or more named parameter on different position.


How confident are you that we can "very easily" do this? Have you looked into how it would need to be implemented, and what edge cases we would need to consider?

At risk of sounding like a broken record: Nikita did look into it, and documented his conclusions in the RFC.


Regards,

--
Rowan Tommins (né Collins)
[IMSoP]

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

Reply via email to