Re: [PHP-DEV] [RFC][Under Discussion] Add functions array_key_first() and array_key_last()

2018-06-15 Thread Enno Woortmann
Hi niel, On 15.06.2018 at 17:37 niel wrote: What is the behaviour if the array does not exist? From the current RFC it appears it would return null? Wouldn't it be better to return false for this situation? Thanks for the comment. Why do you think false would be a better return value? C

Re: [PHP-DEV] [RFC][Under Discussion] Add functions array_key_first() and array_key_last()

2018-06-15 Thread niel
On 13/06/18 20:26, Enno Woortmann wrote: Hello internals, I've changed the status of the currently introduced RFC to add the functions array_key_first() and array_key_last() to "Under Discussion". https://wiki.php.net/rfc/array_key_first_last Regards, Enno What is the behaviour if the arr

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread Larry Garfield
On Friday, June 15, 2018 9:54:48 AM CDT Theodore Brown wrote: > On Thu, Jun 14, 2018 at 4:35 AM, Nikita Popov wrote: > > I think if people want to use strict matching, they'll quite likely want > > to > > have it on all cases. Something like "strict switch ($expr) {}" or "switch > > strict ($expr)

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread Theodore Brown
On Thu, Jun 14, 2018 at 4:35 AM, Nikita Popov wrote: > I think if people want to use strict matching, they'll quite likely want to > have it on all cases. Something like "strict switch ($expr) {}" or "switch > strict ($expr) {}" or "switch (strict $expr) {}" or "switch ($expr) strict > {}" or "sw

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread Rowan Collins
On 15 June 2018 at 14:48, Jordi Boggiano wrote: > Might I suggest a new strictwich ($a) { ... } keyword? It's much more > appetizing. > Or maybe we should follow the pattern of == vs === and double up the "s": "sswitch ($a) { ... }" ;) -- Rowan Collins [IMSoP]

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread Jordi Boggiano
On 15/06/2018 00:10, Stanislav Malyshev wrote: With current tendency to move to more strict interpretation and a bit away from type juggling, I think it has its place. But I am not a big fan to putting === there, it looks weird. Maybe go a bit further and make the whole switch strict? strict swi

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread MichaƂ Brzuchalski
2018-06-15 11:44 GMT+02:00 Christoph M. Becker : > On 15.06.2018 at 08:36, Sebastian Bergmann wrote: > > > Am 14.06.2018 um 10:35 schrieb Nikita Popov: > > > >> It might make sense to introduce an entirely new "match" statement > >> that conforms a bit more with how switch-like strictures are > >>

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread Christoph M. Becker
On 15.06.2018 at 08:36, Sebastian Bergmann wrote: > Am 14.06.2018 um 10:35 schrieb Nikita Popov: > >> It might make sense to introduce an entirely new "match" statement >> that conforms a bit more with how switch-like strictures are >> implemented nowadays. That is, something like >> >> match ($e

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread Rowan Collins
On 14 June 2018 at 23:15, Stanislav Malyshev wrote: > Hi! > > > Would both be more apparent as to its meaning and leave the door open > > for other uses. Though at that point, tbqh, I think `switch ($a) use > > (===) {...}` gives better visual isolation. > > I don't think we should reuse the use