News for hackers. Stuff that matters.
Re:Everything you need (and don't need) to know about PHP's ... by noir_lord on Sunday July 26, 2020 @06:09AM (#23955898)
It's gotten a lot better since I started using it ~2009 and now.

7.4 added typed properties. 8 is adding better caching, a jit and my favourite feature

    match()
https://php.watch/versions/8.0#match-expression

for all the enterprise heavy stuff I write a nicer cleaner and safer (by default) alternative to switch is going to make some code much cleaner to write and read and really that is what I care about more than almost anything else.

That it also returns a value is just the cherry on top. I am so tired of reading bad code with poor intent that has no comments and no documentation that's written in the most counter intuitive way.

Re:Everything you need (and don't need) to know about PHP's ... by untog on Sunday July 26, 2020 @01:12PM (#23958476)
Match looks exactly how Rust’s match works and it’s one of my favourite parts of the language. Happy to see it elsewhere too.
Re:Everything you need (and don't need) to know about PHP's ... by epse on Monday July 27, 2020 @06:32AM (#23963778)
It doesn't really pattern match like rust, but it's still very useful
Re:Everything you need (and don't need) to know about PHP's ... by nawarian on Tuesday July 28, 2020 @06:05AM (#23974132)
Re:Everything you need (and don't need) to know about PHP's ... by admissionsguy on Sunday July 26, 2020 @07:34AM (#23956294)
The match expression is so elegant. For the past 10 years I've been puzzled by how verbose switch is.
Re:Everything you need (and don't need) to know about PHP's ... by noir_lord on Sunday July 26, 2020 @10:23AM (#23957226)
It's better than switch for a lot of switch use cases, it's still not 'real' pattern matching but yeah I'm looking forwards to it.