2 ms·
Yeah, it's more like a switch but as an expression. Some more examples: https://php.watch/versions/8.0/match-expression https://php.watch/versions/8.0/match-exp
by francislavoie 5y ago
Yeah, it's more like a switch but as an expression. Some more examples: https://php.watch/versions/8.0/match-expression https://php.watch/versions/8.0/match-expression It only executes the matching branch, ignoring the others. If you used an array/map + index, then it executes the right-arm of each of the options if they're functions for example, even if their result is thrown away.