Reply to comment

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.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options