$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
$b;
}
echo microtime_float() - $bm;
0.14294600486755
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
isset($b);
}
echo microtime_float() - $bm;
0.19136905670166
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
!empty($b);
}
echo microtime_float() - $bm;
0.21312093734741
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
$a;
}
echo microtime_float() - $bm;
0.10635614395142
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
isset($a);
}
echo microtime_float() - $bm;
0.18292498588562
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
!empty($a);
}
echo microtime_float() - $bm;
0.20766806602478
Nota: Este servidor corre PHP 4, por lo que se definió microtime_float como en el ejemplo 447