The type comparison chart in PHP documentation shows the result of both strict ===
and loose ==
comparisons. There is nothing about inequality comparisons:
true < 0 => false
0 < true => true
true < 1 => false
1 < true => false
true < -1 => false
-1 < true => false
false < 0 => false
0 < false => false
false < 1 => true
1 < false => false
false < -1 => true
-1 < false => false
Can someone rationalize the above results?
when converting booleans to integer, the true will be converted to 1 and false to 0
From PHP Manual: http://php.net/manual/en/language.types.integer.php
Also: