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

This is only part of a thread. view whole thread
  110264
May 22, 2020 23:32 larry@garfieldtech.com ("Larry Garfield")
On Fri, May 22, 2020, at 10:42 AM, Ilija Tovilo wrote:
> Hi Larry > > > My one question is why you're not including the implicit "match (true)" > > in this version, when the secondary vote on the previous RFC was > > 80% in favor of it. > > I received quite a bit of feedback that the RFC was too complex. I > tried to make the RFC simpler by removing all non-essential parts. I'm > ready to create a follow up RFC for this (although it would probably > not make PHP 8.0).
Hm. A logical argument, but given its overwhelming support before and that it's therefore almost certain to pass in the future, I don't see why it's a net win to have PHP 8.0 missing that bit. It seemed uncontroversial, and seems like a highly common use case. --Larry Garfield
  110292
May 28, 2020 15:57 tovilo.ilija@gmail.com (Ilija Tovilo)
Hi Larry

> > > My one question is why you're not including the implicit "match (true)" > > > in this version, when the secondary vote on the previous RFC was > > > 80% in favor of it. > > > > I received quite a bit of feedback that the RFC was too complex. I > > tried to make the RFC simpler by removing all non-essential parts. I'm > > ready to create a follow up RFC for this (although it would probably > > not make PHP 8.0). > > Hm. A logical argument, but given its overwhelming support before and that it's therefore almost certain to pass in the future, I don't see why it's a net win to have PHP 8.0 missing that bit. It seemed uncontroversial, and seems like a highly common use case.
80% were in favor of this feature but it's also worth noting that only 20 people have voted. To avoid risking another rejection and thus the RFC being delayed for a year I'd rather move the feature to a different RFC. Also, the feature being included in the first draft was a rash decision in the first place (completely my fault). There are multiple ways to deal with the value comparison (e.g. do type coercion like the switch or type-error on a non-boolean value) but they haven't been discussed at all. Ilija