On 15 March 2022 15:41:45 GMT, "Côme Chilliet" <c...@chilliet.eu> wrote:
>Le samedi 12 mars 2022, 19:30:00 CET G. P. B. a écrit :
>> true is not a type in PHP compared to false, therefore it is not included.
>> I'm working on a proposal to add true as a type to PHP, but that's a
>> seperate RFC and discussion.
>
>Was there ever an RFC for adding literal values to the type system?
>This would solve all these problems by allowing stuff like:
>
>function foobar(): "foo"|"bar"|true {
>}

It's called enums ;-), so yes! 

cheers 
Derick 

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

Reply via email to