Re: Bug #80248 - Swapping parameter names during inheritance does not throw
| From: | Rowan Tommins | Date: | Wed, 28 Oct 2020 16:43:25 +0000 |
| Subject: | Re: Bug #80248 - Swapping parameter names during inheritance does not throw | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112134@lists.php.net to get a copy of this message | ||
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]