Hi Levi,

The patch is here https://gist.github.com/dstogov/8deb8b17e41c1a5abf88

I improved memory consumption and unified return type-hinting error
behavior with existing argument type-hinting.
The main semantic must be unchanged.
I also removed part of Reflection changes. I think we should remove even
more and later introduce similar APIs for both argument and return
type-hinting at once.

Working on the patch I found few problems.

1) Return type-hinting for generators in existing state is useless. We may
use it for checking "yield" value instead of "returned" or just disable it
for now.

2) "Covariant" return type check is really problematic. It delays class
binding to run-time, and requires all classes, used in hints, to be loaded.
I would prefer to simplify this by using "Invariant" return types (similar
to arguments) and checking just class names (without their loading).

Thanks. Dmitry.


On Tue, Nov 4, 2014 at 5:01 AM, Levi Morrison <morrison.l...@gmail.com>
wrote:

> Dear Internals,
>
> I am pleased to announce that the return type RFC is now open for
> voting[1]. Note that the implementation needs a bit of cleaning up
> before merging should the RFC be accepted; Dmitry has already
> volunteered to help with that, but more eyes are welcome.
>
> A couple of things have changed in reflection[2] since the last
> iteration, but is otherwise the same.
>
> The implementation is slightly out of date with the RFC, but soon it
> will be updated to match.
>
>   [1]: https://wiki.php.net/rfc/returntypehinting#vote
>   [2]: https://wiki.php.net/rfc/returntypehinting#reflection
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to