There are lots of examples of false positives when using ==
to compare two strings in PHP.
For example, '1' == '1.0'
is true.
However, are there any false negatives? Is there some string $a
such that $a == $a
is false due to type juggling?
There are lots of examples of false positives when using ==
to compare two strings in PHP.
For example, '1' == '1.0'
is true.
However, are there any false negatives? Is there some string $a
such that $a == $a
is false due to type juggling?
No, php will not provide false negatives. php will create false positives via type juggling as a feature (it tries to help).
Related questions: