The following tables demonstrate behaviors of PHP
operators, for both loose and strict comparisons. This
supplemental is also related to the manual section on
Inspiration was provided by various user comments and by the work over at
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
HTML Forms do not pass integers, floats, or booleans; they pass strings.
To find out if a string is numeric, you may use
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.