Larry Garfield, Director of Developer Experience at platform.sh, have written an introductory post on PHP 8.0 new feature match(), which go beyond switch/case directives limitation.

While it gets the job done, the classic switch has a number of limitations. Most newer languages like Go or Rust have opted for more robust, less error-prone structures that go by a variety of names. And now, PHP has one, too.

The match expression RFC comes to us courtesy of Ilija Tovilo. The PHP 8.0 pre- release copy is already available on platform.sh and should be released really soon around the end of November 2020.

LEAVE A REPLY

Please enter your comment!
Please enter your name here