On 26.09.2019 at 10:06, Nikita Popov wrote:

> This RFC is currently held up by a lack of implementation. Once that is
> done, the RFC will go forward as-is (barring any novel concerns). Because I
> consider it an important part of the overall proposal (*), I will neither
> remove the false type, nor split it into a separate vote. People may vote
> against the whole RFC if they disagree with this aspect, or any other
> aspect of the proposal.
>
> (*) While certainly not the primary reason for why we should support union
> types, the reason why I brought this proposal forward at this time
> specifically, is that the lack of union types is a blocker for my pet
> project of providing comprehensive type annotations for internal functions.
> Supporting "false" is strictly necessary for this purpose, because it is
> part of nearly all unions as far as internal functions are concerned.

Maybe an option would be to introduce "falsable" types by marking them
with an exclamation mark in front?  While I'm generally not in favor of
having failure signalled by returning false (except for bool functions),
and it wouldn't solve the issue generally (some functions can return
multiple types in addition to false), it appears to fit to be able to
mark nullable types with a question mark.

By the way, I wouldn't call that a "pet project".  In my opinion, that
is a really big improvement, and I hope that these stub files can become
the single source of truth in the not too distant future.

Regards,
Christoph

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to