On 04/13/2012 09:12 AM, Rasmus Lerdorf wrote:
On 04/13/2012 09:09 AM, Stas Malyshev wrote:
However I think it would make sense not to use this conversion in string
comparisons when we know it's lossy - it seems to be outside of the use
case for such comparisons and it seems apparent by now that it is hard
for people to understand why it works this way.
Yup, I agree, if the type juggling loses data we should skip the juggle
and do a direct comparison which I think is what Gustavo's patch does.
If people explicitly cast things then the cast, even if it is lossy,
should happen.

-Rasmus


Sadly when I proposed this many months ago my post was ignored. :-(
Just chiming in to say +1 for this type of operation. This problem was extremely frustrating and took a while to figure out exactly what was going on, as I had wrongly assumed casting to string at the comparison would cause a strcmp.

-Matt

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

Reply via email to