Hey Tyson,

On Sat, Apr 24, 2021, 19:24 tyson andre <tysonandre...@hotmail.com> wrote:

> Hi Marco Pivetta,
>
> > In fact, if reflection were to switch to the actual runtime return types
> of
> > those methods, I don't see a reason why downstream consumers would break
> > (stubbing tools, code generators, type checkers, dependency solvers,
> etc.)
>
> If the published library/application had to support older versions (e.g.
> php 7.4),
> but the tentative return types contained types/syntaxes that required php
> 8.0
> (e.g. union types such as `string|false`, new types such as
> `mixed`/`never`, etc,)
> then the code generators and type checkers and stubbing tools would need
> to be
> updated to exclude the new tentative return types much earlier than
> absolutely needed.
>

>From experience, code generated with tooling while running on newer PHP
versions is already incompatible with older PHP versions: you re-generate
the code when changing any of the dependencies anyway (think "no ABI
compatibility").

This is at least true for all codegen tools I worked/contributed to/used on
so far.

We're mostly breaking BC (new methods on reflection symbols, requiring
special treatment) for stuff that is really an edge case that is only
affecting tooling that would really work just fine even if the reflection
API started to report the real return types now (no API change whatsoever).

What's the plan for PHP 9 about these methods? Deprecation/removal? Or are
we adding something that we'll have to drag on forever?

Reply via email to