Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread li...@rhsoft.net
Am 10.09.2017 um 22:35 schrieb Rowan Collins: On 10/09/2017 20:35, li...@rhsoft.net wrote: with " strict_types does not currently have any effect on comparisons anywhere, and nor is it likely ever to do so. It is a very specific option, not a broad set of behaviours like "use strict" in JS o

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Rowan Collins
On 10/09/2017 20:35, li...@rhsoft.net wrote: the whole switch discussion is broken by design with " strict_types does not currently have any effect on comparisons anywhere, and nor is it likely ever to do so. It is a very specific option, not a broad set of behaviours like "use strict" in JS o

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Dustin Wheeler
On Sun, Sep 10, 2017 at 4:18 PM, Rowan Collins wrote: > > The choice of "use" as the keyword was largely because it's already a > reserved word, with multiple meanings in different contexts. As well as > anonymous functions, it's the keyword for importing names from other > namespaces, and for inc

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Rowan Collins
On 10/09/2017 20:16, Theodore Brown wrote: On Sunday, September 10, 2017 12:45 PM Rowan Collins wrote: >>> Would it be possible to add an optional `$strict` parameter to >>> switch? E.g. >>> ``` >>> switch ($i, true) { >> >> I'd very much prefer a "strict switch ($i) { ... }" over a second pa

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread li...@rhsoft.net
Am 10.09.2017 um 21:25 schrieb Ryan Pallas: On Sep 10, 2017 1:23 PM, "li...@rhsoft.net " mailto:li...@rhsoft.net>> wrote: Am 10.09.2017 um 21:16 schrieb Theodore Brown: On Sunday, September 10, 2017 12:45 PM Rowan Collins mailto:rowan.coll...

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Ryan Pallas
On Sep 10, 2017 1:23 PM, "li...@rhsoft.net" wrote: Am 10.09.2017 um 21:16 schrieb Theodore Brown: > On Sunday, September 10, 2017 12:45 PM Rowan Collins < > rowan.coll...@gmail.com> wrote: > > Would it be possible to add an optional `$strict` parameter to switch? E.g. ``` switch

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread li...@rhsoft.net
Am 10.09.2017 um 21:16 schrieb Theodore Brown: On Sunday, September 10, 2017 12:45 PM Rowan Collins wrote: Would it be possible to add an optional `$strict` parameter to switch? E.g. ``` switch ($i, true) { I'd very much prefer a "strict switch ($i) { ... }" over a second parameter. Wha

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Theodore Brown
On Sunday, September 10, 2017 12:45 PM Rowan Collins wrote: >>> Would it be possible to add an optional `$strict` parameter to >>> switch? E.g. >>> ``` >>> switch ($i, true) { >> >> I'd very much prefer a "strict switch ($i) { ... }" over a second parameter. > > What do either of you think of my

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Rowan Collins
On 10/09/2017 17:27, Niklas Keller wrote: 2017-09-10 18:05 GMT+02:00 Theodore Brown : Would it be possible to add an optional `$strict` parameter to switch? E.g. ``` switch ($i, true) { I'd very much prefer a "strict switch ($i) { ... }" over a second parameter. What do either of you think

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Niklas Keller
2017-09-10 18:05 GMT+02:00 Theodore Brown : > On Saturday, September 9, 2017 6:21 AM, ilija.tov...@me.com wrote: > > > I find myself writing switch statements in PHP quite rarely. This has a > few reasons: > > 1. It doesn’t have a "strict_types” version > > ... > > I assume that some people will n

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Theodore Brown
On Saturday, September 9, 2017 6:21 AM, ilija.tov...@me.com wrote: > I find myself writing switch statements in PHP quite rarely. This has a few > reasons: > 1. It doesn’t have a "strict_types” version > ... > I assume that some people will not be so happy about having to switch-like > construct

Re: [PHP-DEV] [RFC] Match expression

2017-09-10 Thread Rowan Collins
On 09/09/2017 12:21, ilija.tov...@me.com wrote: Hi everybody! Has this idea been discussed before? I find myself writing switch statements in PHP quite rarely. This has a few reasons: 1. It doesn’t have a "strict_types” version 2. It is quite verbose (lots of breaks) 3. It is a statement rath

[PHP-DEV] [RFC] Match expression

2017-09-09 Thread ilija . tovilo
Hi everybody! Has this idea been discussed before? I find myself writing switch statements in PHP quite rarely. This has a few reasons: 1. It doesn’t have a "strict_types” version 2. It is quite verbose (lots of breaks) 3. It is a statement rather than an expression Often, if / elseif statemen