3 ms·
As others are saying, I don't think "==" vs "===" are a bad thing, what is bad is allowing 2 objects of different types to be compared, which is really why this
by seanalltogether 4y ago
As others are saying, I don't think "==" vs "===" are a bad thing, what is bad is allowing 2 objects of different types to be compared, which is really why this md5 bug occurs. The implicit coercion from one type into another automatically creates a rats nest of problems.
- LinAGKar 4y agoNo, here they were both the same type, but they were cast to int anyway.
- seanalltogether 4y agoI understand, but the root cause is allowing equality checks between different types. As a result of that decision you need cascading rules on what conversions take higher priority then others. Clearly php has decided that when a string goes through an equality check against another object, that integer conversion is placed above byte comparison