On that note, since traits aren't possible as a return type. Would it
be possible to determine that the given return type is a trait? In
that case a more specific error message could also be possible.
I don't know much of the internals, so i don't know if that is even
possible atm, but it would be a nice addition.
On Mon, 14 Oct 2019 at 09:53, Stanislav Malyshev <firstname.lastname@example.org> wrote:
> > I was about to give my +1 on the more generic approach, but type hints
> > could also be interfaces and "instance of the class X" is not a good fit.
> We could use "class or interface" if that's important.
> Stas Malyshev
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php