Note that safe type checking (using === and !== instead of == and !=) is in general somewhat faster. When you're using non-safe type checking and a conversion is really needed for checking, safe type checking is considerably faster.
===================================
Test (100,000,000 runs):
<?php
$start = microtime(true);
for($i = 0; $i < 100000000; $i++)
if(5 == 10) {}
$end = microtime(true);
echo "1: ".($end - $start)."<br />\n";
unset($start, $end);
$start = microtime(true);
for($i = 0; $i < 100000000; $i++)
if('foobar' == 10) {}
$end = microtime(true);
echo "2: ".($end - $start)."<br />\n";
unset($start, $end);
$start = microtime(true);
for($i = 0; $i < 100000000; $i++)
if(5 === 10) {}
$end = microtime(true);
echo "3: ".($end - $start)."<br />\n";
unset($start, $end);
$start = microtime(true);
for($i = 0; $i < 100000000; $i++)
if('foobar' === 10) {}
$end = microtime(true);
echo "4: ".($end - $start)."<br />\n";
unset($start, $end);
?>
===================================
Result (depending on hardware configuration):
1: 16.779544115067
2: 21.305675029755
3: 16.345532178879
4: 15.991420030594