phpoperatorscomparison-operatorsequality-operatoridentity-operator

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


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


Solution

  • 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.