The PHP manual operator is described in:
Compare multiple types--
such as Var_dump ([] > 0); Result is True
Number of operations 1 types |
Number of Operations 2 types |
Results |
Null or string |
String |
NULL convert to "" for numeric or lexical comparisons |
BOOL or null |
Any other type |
Convert to bool, FALSE < TRUE |
Object |
Object |
Built-in classes can define their own comparisons, non-homogeneous cannot be compared, the same class and arrays are the same way to compare properties (PHP 4), PHP 5 has its own description |
String,resource, or number |
String,resource, or number |
Converts strings and resources to numbers, compared by ordinary numbers |
Array |
Array |
Arrays with fewer members are smaller if the keys in the operand 1 do not exist in the operand 2, the array cannot be compared, otherwise the values are compared |
Object |
Any other type |
object is always bigger |
Array |
Any other type |
Array is always larger |
PHP two values to compare the problem