2010/1/13 Rasmus Lerdorf <ras...@lerdorf.com>:
> Richard Quadling wrote:
>> Hello.
>>
>> In looking at numer vs string comparison, I think I've found an oddity.
>>
>> You can successfully compare hex strings ...
>>
>> var_dump(255 == '0xff');
>>
>> but not octal strings ...
>>
>> var_dump(63 == '077');
>>
>>
>> Is this a bug (lack of octal support) or an unexpected feature (hex support)?
>
> We don't have octal strings in PHP.  Only native octal.
> eg.
> var_dump(63 == 077);
>
> Why?  Mostly because octal strings is more likely to cause incorrect
> behaviour than both regular numeric strings and hex strings.
>
> -Rasmus
>

Thank you.

Should [1] be updated to include hex strings and a note about octal strings?

Richard.


[1] 
http://docs.php.net/manual/en/language.types.string.php#language.types.string.conversion
-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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

Reply via email to