1. For arrays
$ A = array (1, 2, 3, 6 );
$ B = array (1, 2, 3, 6, 8 );
Echo "\ n ";
Var_dump ($ a> $ B );
Var_dump ($ a = $ B );
Var_dump ($ a <$ B );
Result:
Boolean false
Boolean false
Boolean true
Ps: the array with fewer members is small.
$ A = array (1, 2, 3, 6, 9 );
$ B = array (1, 2, 3, 6, 8 );
Echo "\ n ";
Var_dump ($ a> $ B );
Var_dump ($ a = $ B );
Var_dump ($ a <$ B );
Boolean true
Boolean false
Boolean false
Ps: case-by-case comparison
$ A = array (1, 2, 3, 6, 'B' => 3 );
$ B = array (1, 2, 3, 6, 8 );
Echo "\ n ";
Var_dump ($ a> $ B );
Var_dump ($ a = $ B );
Var_dump ($ a <$ B );
Boolean false
Boolean false
Boolean false
Ps: if the key in Operation Number 1 does not exist in Operation Number 2 and the array cannot be compared, false is returned.
2. Comparison between bool or null and Other Types
Var_dump (bool) (null); // boolean false // false when the value of null is converted to bool;
Convert null and other types to bool, and then compare, and FALSE <TRUE