Hi

Am 2026-01-23 20:48, schrieb Larry Garfield:
The idea of the second being that, if you want just an identity match, you can skip adding `is` on just that one arm.

I don't understand what that is trying to say.

2. Positional array patterns. How picky should the pattern matching be for list-esque arrays? There's 3 options listed in the RFC as possible ways forward, so I won't repeat them here but just provide a link:

https://wiki.php.net/rfc/pattern-matching#positional_array_enforcement

I expect "list patterns" to be reasonably short, such that `array_is_list()` would effectively be constant-time after checking whether the number of elements matches up. As such I would prefer (1) "Include the list check, accept the cost".

`$o is object(x: 1)`

That would be okay, but no strong feelings.

4. The variable pinning syntax. There's been some concerns about it being non-obvious, which is valid. The main argument for it is "it's what Ruby does", which is not the most compelling argument, but it's not invalid.

Is there some other syntax that would work better? Ilija has pondered `{$x}`, which would then potentially allow simple expressions inside the pattern within the {}. I am a little scared of the scope creep potential. :-) But we're open to having this discussion, so please discuss.

As I think I said before, I don't need variable pinning at all, but `^` in particular is terrible. `{}` would be okay, but I prefer just not making a decision for now.

Best regards
Tim Düsterhus

Reply via email to