# [RFC] [Discussion] Bound-Erased Generic Types

- Thread: https://externals.io/message/130881
- Original archive: https://news-web.php.net/php.internals/130881
- Started by Zebulan on 2026-05-14T02:18:45+00:00
- Messages: 1
- 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

---

## #130881 — Zebulan — 2026-05-14T02:18:45+00:00

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

> Hi Daniil,
>
> Thanks for the support. That matters a lot.
>
> > […]
>
> I personally like Turbofish; however, I understand that some people
> might not find it "pretty". But the reason it has to stay as turbofish
> is parser-level: `[A(D)]` is ambiguous between a single-element
> array calling generic A and a two-element array of comparisons, and
> there's no context-sensitive disambiguation that works inside
> attributes, array expressions, and ternaries without introducing rules
> that bite at exactly the worst places. Forcing parentheses around the
> call (`[(A(D))]`) was suggested earlier in the thread and is
> uglier than turbofish; it also closes the door on tuple syntax I'd
> like to keep open for a future RFC. Turbofish costs two characters and
> keeps the parser non-context-sensitive, which is the trade I'd rather
> take.
>
> The `[self::foo::(1), self::foo::(2)]` case genuinely looks
> the worst. The same call without turbofish (`[self::foo(1),
> self::foo(2)]`) reads fine and is what the vast majority of call sites
> will look like, since turbofish is opt-in for ambiguity resolution
> (because inference is hard), and most calls won't need it.
>
> > […]
>
> Secondary vote added on this. `+T`/`-T` vs `in T`/`out T`. I have no
> strong preference; the vote will decide.
>
> > […]
>
> Side note: I'm optimistic ;)
> https://github.com/carthage-software/mago/pull/1826
>
> Thanks again for the careful read.
>
> Cheers,
> Seifeddine.

Leaving-the-door-open-for-tuples is a good additional argument for using the turbofish syntax; I'd say it's important enough to mention in the RFC.
