# [RFC] Pattern Matching

- Thread: https://externals.io/message/129562
- Original archive: https://news-web.php.net/php.internals/129562
- Started by Zebulan on 2025-12-05T15:10:30+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #129562 — Zebulan — 2025-12-05T15:10:30+00:00

URL: https://externals.io/message/129562#129562

Some typos I spotted in the RFC:

"Structure patterns" -> "Object pattern" section: color: green​ should be color: 'green'​ (twice)

"Future Scope" -> "Regex pattern" section: "idiation" should be "ideation"

Also, to better justify the syntax for variable pinning, perhaps it might be worth mentioning that the caret character kinda looks like a pin? I'm not entirely sold on the syntax myself, but I think that visual association makes it easier to mentally parse.
Finally, in the research document, I see there was some confusion about the C# syntax for variable binding. I think the idea is that the right-hand side looks like a variable declaration, so since int foo​ is how you define an integer variable named foo​, therefore it makes sense to reuse the syntax in bar is int foo​.

---

## #129563 — Larry Garfield — 2025-12-05T15:34:37+00:00

URL: https://externals.io/message/129562#129563 · In reply to: #129562

> Some typos I spotted in the RFC:
>
> "Structure patterns" -> "Object pattern" section: `color: green`​ 
> should be `color: 'green'`​ (twice)
>
> "Future Scope" -> "Regex pattern" section: "idiation" should be "ideation"
>
> Also, to better justify the syntax for variable pinning, perhaps it 
> might be worth mentioning that the caret character kinda looks like a 
> pin? I'm not entirely sold on the syntax myself, but I think that 
> visual association makes it easier to mentally parse.
>
> Finally, in the research document, I see there was some confusion about 
> the C# syntax for variable binding. I think the idea is that the 
> right-hand side looks like a variable declaration, so since `int foo`​ 
> is how you define an integer variable named `foo`​, therefore it makes 
> sense to reuse the syntax in `bar is int foo`​.

Thanks, typos fixed!

--Larry Garfield
