PHP 7.4 string comparison
one text
Solution:
The != operator performs a comparison with type juggling. Since the first operand is an int, the comparison is performed numerically, and the second operand is coerced to an int too. This means the first sequence of digits is taken and converted to an int, and everything after it is discarded. In the first example, the first sequence of digits is "1", so you get 1 != 1, which is obviously false. In the second example, you similarly get 1 != 2, which is obviously true.