- microtime: documentation ( source)
<?php
$x = null;
$i = 1000000;
$t = microtime(true);
while ($i--) {
$y = is_null($x);
}
echo microtime(true) - $t, PHP_EOL;
$i = 1000000;
$t = microtime(true);
while ($i--) {
$y = null === $x;
}
echo microtime(true) - $t, PHP_EOL;