Submitted by jesse (not verified) on Fri, 06/19/2009 - 14:12.
=== is also necessary when you are comparing strings that are very long numbers - like a GSM cell phone's SIM card number (which is where I ran into it). For example:
I think it just happens on strings over 20 chars, but that may be based on some setting. As soon as you put a non-number in there, that stops happening.
plus....
=== is also necessary when you are comparing strings that are very long numbers - like a GSM cell phone's SIM card number (which is where I ran into it). For example:
echo var_dump( ("11111111111111111111"=="11111111111111111112") )."\n";echo var_dump( ("11111111111111111111"==="11111111111111111112") ) ."\n";
will give you
bool(true)
bool(false)
I think it just happens on strings over 20 chars, but that may be based on some setting. As soon as you put a non-number in there, that stops happening.