Re: [PHP-DEV] Resurrecting named parameters

2020-04-28 Thread Benjamin Eberlei
On Tue, Apr 7, 2020 at 2:45 PM Nikita Popov wrote: > Hi internals, > > It's been a few years since I originally brought up the named parameters > RFC: https://wiki.php.net/rfc/named_params > > This topic has recently come up as part of > https://externals.io/message/109220 again, in particular

Re: [PHP-DEV] Resurrecting named parameters

2020-04-17 Thread Nikita Popov
On Thu, Apr 9, 2020 at 7:21 AM Stanislav Malyshev wrote: > Hi! > > > 2. Throw a notice if a parameter name is changed. While LSP violations > are > > normally fatal errors (in PHP 8), we could use a lower-severity > diagnostic > > for this case, that allows code to still run, but makes

Re: [PHP-DEV] Resurrecting named parameters

2020-04-10 Thread Jakob Givoni
On Tue, Apr 7, 2020 at 2:45 PM Nikita Popov wrote: > > ## LSP checks for parameter names > > Parameter names currently have no particular significance in PHP, only > their position in the signature is important. If named parameters are > introduced (in a way that does not require opt-in at the

Re: [PHP-DEV] Resurrecting named parameters

2020-04-08 Thread Stanislav Malyshev
Hi! > 2. Throw a notice if a parameter name is changed. While LSP violations are > normally fatal errors (in PHP 8), we could use a lower-severity diagnostic > for this case, that allows code to still run, but makes developers aware of > the problem. (It should be noted that automatic fixup of

Re: [PHP-DEV] Resurrecting named parameters

2020-04-08 Thread Côme Chilliet
Le mardi 7 avril 2020, 14:44:38 CEST Nikita Popov a écrit : > The larger problem is that internal functions don't have a well-defined > concept of parameter default value. Parameter defaults are implicit in C > code, and sometimes based on argument count checks. When named parameters > are

Re: [PHP-DEV] Resurrecting named parameters

2020-04-07 Thread Rowan Tommins
On 07/04/2020 13:44, Nikita Popov wrote: Make named-parameter opt-in in some fashion, so that parameter names only need to be preserved for methods that have the opt-in marker. I'm not a fan of this, as it greatly diminishes the practical usefulness of named parameters. I generally prefer the

Re: [PHP-DEV] Resurrecting named parameters

2020-04-07 Thread Levi Morrison via internals
On Tue, Apr 7, 2020 at 6:45 AM Nikita Popov wrote: > > ## LSP checks for parameter names > > Parameter names currently have no particular significance in PHP, only > their position in the signature is important. If named parameters are > introduced (in a way that does not require opt-in at the

[PHP-DEV] Resurrecting named parameters

2020-04-07 Thread Nikita Popov
Hi internals, It's been a few years since I originally brought up the named parameters RFC: https://wiki.php.net/rfc/named_params This topic has recently come up as part of https://externals.io/message/109220 again, in particular with the observation that the combination of constructor parameter