On 28/10/2020 15:14, Michael Voříšek - ČVUT FEL wrote:
I agree - "it's harder to imagine a scenario in real life where".
[...]
If we can agree, that implementation is not guaranteed to be called with
named parameters only, what real world usecase to defend this current
php behaviour is left?
You're thinking about this the wrong way around: the simplest
implementation is to detect non-existent named parameters (which happens
to include renamed parameters) at run-time; it is additional checks on
top of that which need to be justified.
Other approaches to the problem require at least one of:
* Significant additional code in the engine to perform additional checks
and/or name aliasing
* Users to change existing code which works correctly, but would
theoretically break if used with named parameters
The advantages are almost entirely theoretical, with few realistic
examples.
So the "pragmatic approach" the RFC refers to concludes that the benefit
of additional analysis does not outweigh its cost.
Regards,
--
Rowan Tommins (né Collins)
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php