> <?php echo '0' == '0.0000e0' ?>
> 1
>
> <?php echo '0' == 'asadoaskd' ?>
> (nothing, false)
>
> <?php echo '0' == (int)'adasd' ?>
> 1
>
> That confuses me more (but understandable, and thank God PHP behave
> this way)... I thought 'asdasd' is 0 when [implicitly] converted to
> int [for comparison]? I guess I never knew PHP well :-(
>
That would be the 'Roughly Speaking' and 'not precisely how the engine
handles it internally' parts.

In the case of string to string comparison there must be at least one digit
involved at the start of the string  (or a plus/minus sign followed by
digits, etc...) in order to qualify as a numeric string.

if (int && string) convert to int
if (string && int) convert to int
if (string && string && both strings start with numerics) convert both to
int

There's also float versions of those, but... you get the picture.

-Sara

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

Reply via email to