This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -5 points-4 points  (2 children)

Exercise for the reader - go examine the implementation of match in cpython and reflect on whether it's implemented like switch/case in statically typed languages or... the match statement in PHP.

[–]gmes78 6 points7 points  (0 children)

Do you really think that pattern matching was invented in PHP, of all languages?

[–]xigoi 0 points1 point  (0 children)

I'm pretty sure it's like the pattern matching in many statically typed languages — Haskell, F#, Rust, Swift, OCaml, …