Re: [PHP-DEV] List of attributes

2020-10-28 Thread Rowan Tommins
On 28/10/2020 16:58, Nicolas Grekas wrote: about why we'd need nested attributes, here is a discussion about nested validation constraints: https://github.com/symfony/symfony/issues/38503 Thanks, it's useful to see some real-world examples. As I suspected, nearly all of these explicitly take

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Rowan Tommins
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 na

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
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. On class creation time, ie. only once, no overhead per call. Th

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
see https://3v4l.org/X8omS As long as non-named parameters are supported (they always will be), calling different implementation can produce different results when called with named/not-named parametrs. Let say we have interface/class X with method test(int $offset, int $limit). Let's exten

Re: [PHP-DEV] List of attributes

2020-10-28 Thread Nicolas Grekas
Hi all! about why we'd need nested attributes, here is a discussion about nested validation constraints: https://github.com/symfony/symfony/issues/38503 You'll see that we're looking hard into ways around using nested attributes, but they all fall short. We actually concluded that we should not c

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Rowan Tommins
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? Y

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Chase Peeler
On Wed, Oct 28, 2020 at 11:15 AM Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > I agree - "it's harder to imagine a scenario in real life where". > > From php perspective, swapping parameters in inheritance SHOULD NOT be > allowed, as without named parameters the parameters are not sw

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
I agree - "it's harder to imagine a scenario in real life where". From php perspective, swapping parameters in inheritance SHOULD NOT be allowed, as without named parameters the parameters are not swapped. Also, if the parameters are typed differently, the example is even impossible (and nowday

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Rowan Tommins
On 28/10/2020 10:45, Michael Voříšek - ČVUT FEL wrote: https://3v4l.org/X8omS parameters renamed, result with named parameters is different While it's easy to construct an example where this happens, it's harder to imagine a scenario in real life where: * a sub-class overloads the function

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
I see, guys, what is the single reason to allowing this dangerous inheritance? https://3v4l.org/X8omS parameters renamed, result with named parameters is different https://3v4l.org/kgHWf renamed parameter, call with named parameters does not succeed at all (which violated basic principe of O