The official php Manual provides an example of bool and = operations: Beware & nbsp; of & nbsp; certain & nbsp; control & nbsp; behavior & nbsp; with & nbsp; boolean & nbsp; and & nbsp; non & nb bool and =
An example is provided in the official php manual:
Beware of certain control behavior with boolean and non boolean values :
// Consider that the 0 could by any parameters including itself
var_dump(0 == 1); // false
var_dump(0 == (bool)'all'); // false
var_dump(0 == 'all'); // TRUE, take care
var_dump(0 === 'all'); // false
// To avoid this behavior, you need to cast your parameter as string like that :
var_dump((string)0 == 'all'); // false
?>
Why var_dump (0 = 'all'); is true. Does the = operator cause type conversion?
But why ......
------ Solution --------------------
Yes, php converts the data type.
Since it is relatively large, it must be the same data type for comparison.