Difference between "three equal signs" and "two equal signs" in PHP
Analyze the differences between the three equal signs ===and the two equal signs ===in php. For more information, see. Recently, I want to study the specific differences between "=" and "=" in php. In fact, "=" is also used for comparison, but the comparison requirements are stricter. It is required that the types on both sides be compared; For example: $ A = 8; if ($ a = 8.0) or if ($ a = 8) both return TRUE; but if ($ a = 8.0) returns false. because the two types are different, true is returned only if ($ a = 8;Assume that a function returns the following situations: 1. number greater than 0 2. number less than 0 3. number equal to 0 (that is, 0) 4. False (when a failure occurs). to capture a failure, use = instead of =. Why? Because = matches 4th cases and 3rd cases, because 0 is false. |