Why PHP casts two numerical strings to numbers before [loosely] comparing them?
问题 I browsed through several similar questions, but they all only state the fact: If ... comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically. Okay, I got it. It explains what is going on when '00001' == '1' returns TRUE . The question is: Why PHP does so? What is the reason for probing strings for being numeric, and then casting if so? Why can't we just compare two strings already? I can fairly understand what casting is