$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
$b;
}
echo microtime_float() - $bm;
0.11579608917236
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
isset($b);
}
echo microtime_float() - $bm;
0.18190312385559
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
!empty($b);
}
echo microtime_float() - $bm;
0.20620894432068
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
$a;
}
echo microtime_float() - $bm;
0.11346411705017
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
isset($a);
}
echo microtime_float() - $bm;
0.18158197402954
$bm = microtime_float();
for ($a = 0; ++$a < 1000000;) {
!empty($a);
}
echo microtime_float() - $bm;
0.22020602226257
Nota: Este servidor corre PHP 4, por lo que se definió microtime_float como en el ejemplo 447