Why is === faster than == in PHP?
In php (c code) value is a "class" like:
class value
{
$int_;
$float_;
$string_;
$array_;
$object_;
}
When your are comparing $a == $b and $a is int type, there will be something like:
if ($a->int_ == $b->int_ || $a->int_ == (int) $b->float_ || $a->int_ == (int) $b->string_ || ...)
but string '1' will not be cast to ascii code 49, it will be 1.
When you are comparing $a === $b and $a is int type, there will be someting like:
if ($a->int_ == $b->int_)