On 15 June 2015 20:55:04 BST, Bob Weinand <bobw...@hotmail.com> wrote:
>As far as I know, we made it that way in order to enforce an int return
>type all the time.
>int(-1) is indeed the sensible value for this. (Mainly int(0) does not
>work because it'd mean equality and so we're left with int(-1) and
>int(1).)
>
>Just because other comparison ops already return a bool, we can return
>bool(false) there.

This makes a lot of sense. If it returned false, that would just be cast to 0 
in most situations, implying that NaN is equal to everything (rather than 
nothing). In other situations, it would simply lead to an error. The operator 
would lose much of its value if it had to be surrounded with error traps and 
caveats because it didn't reliably return an integer.

Regards,
-- 
Rowan Collins
[IMSoP]


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

Reply via email to