Hi!

> In any case, your selective quoting destroyed the main point of my
> e-mail -- that is, this problem implicates these questions: is 
> "9223372036854775808" different from 9223372036854775808? Is 
> "9223372036854775808" still deemed to represent an integer, even
> though we cannot represent it as an integer type?

Well, it is different, as it looks like from usage patterns. You can't
get int 9223372036854775808 from database or web form, but you very well
can get string "9223372036854775808".

> I think most people can agree that this behavior is correct:
> 
> var_dump(9223372036854775807 == 9223372036854775808); //true

I would say, yes, this is fine.

> therefore, we need some -- principled -- distinction to treat case 
> "9223372036854775807" == "9223372036854775808" differently. The 
> distinction I propose is answering "yes" to the questions above --
> they represent different entities and when no conversion of the
> integer string to the integer type can't be done we should fall back
> to memcmp(). This is what is already done with the overflowing
> "1e400". I don't find it particularly convincing, though.

I think this is the way to go, unless somebody proposes a better way to
handle it.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to