Why is === faster than == in PHP?

coderex picture coderex · Mar 8, 2010 · Viewed 34.1k times · Source

Why is === faster than == in PHP?

Answer

meder omuraliev picture meder omuraliev · Mar 8, 2010

Because the equality operator == coerces, or converts, the data type temporarily to see if it’s equal to the other operand, whereas === (the identity operator) doesn’t need to do any converting whatsoever and thus less work is done, which makes it faster.