Non-strict comparisons in PHP are always not easy to work with, and here is the last piece of this common issue:
- PHP < 8.0: “one operand is a number and the other one is a numeric string, then the comparison is done numerically”.
- PHP >= 8.0: “Non-strict comparisons between numbers and non-numeric strings now work by casting the number to string and comparing the strings.”




