PHP type comparison tables

The following tables demonstrate behaviors of PHP
types and
comparison
operators, for both loose and strict comparisons. This
supplemental is also related to the manual section on
type juggling.
Inspiration was provided by various user comments and by the work over at
» BlueShoes.

Before utilizing these tables, it's important to understand types and their
meanings. For example, "42" is a string
while 42 is an integer. FALSE is a
boolean while "false" is a
string.

Note:

HTML Forms do not pass integers, floats, or booleans; they pass strings.
To find out if a string is numeric, you may use
is_numeric().

Note:

Simply doing if ($x) while $x is
undefined will generate an error of level E_NOTICE.
Instead, consider using empty() or
isset() and/or initialize your variables.

Note:

Some numeric operations can result in a value represented by the constant
NAN. Any loose or strict comparisons of this value
against any other value, including itself, will have a result of FALSE.
(i.e. NAN != NAN and NAN !== NAN)
Examples of operations that produce NAN include
sqrt(-1), asin(2), and
asinh(0).