RE: [PHP-DEV] Reviving scalar type hints
| From: | François Laupretre | Date: | Tue, 17 Feb 2015 15:30:47 +0000 |
| Subject: | RE: [PHP-DEV] Reviving scalar type hints | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82973@lists.php.net to get a copy of this message | ||
> De : Lester Caine [mailto:lester@lsces.co.uk]
>
> Returning 'not-zero/empty' as true and 'zero' as false is one of the
> natural things to use in PHP and I don't think any other language has
> that flexibility?
You didn't read it right.
I was talking of conversions *from* bool, not *to* bool. (int -> bool) is fine and will be
preserved, but I propose to remove (bool -> int). You will still return numbers as bool, and
non-zero will still be converted to true. Relax :)
Regards
François