Why for php
\'00\' == \'0000\'
expression is true
?
Is it explained somewhere in manual?
NOTE:
Just read:
If [...] the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically
I removed the part that probably was standing in your way.
It's also good to remember that
If you compare a number with a string or the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically. These rules also apply to the switch statement. The type conversion does not take place when the comparison is === or !== as this involves comparing the type as well as the value. enter link description here
But everything everyone else has said is correct!
"If you compare a number with a string or the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically." (PHP manual)
Because when you compare this strings they become zeros on both sides so 0 == 0 is true, try to use '00' === '0000'
here is link
Sure
== compares values and neglects type
=== compares values and types
here is it:
http://php.net/manual/en/language.operators.comparison.php
*UPDATE:
Read this part in this URL :
http://php.net/manual/en/function.intval.php
Strings will most likely return 0 although this depends on the leftmost characters of the string. The common rules of integer casting apply.