- microtime: documentation ( source)
- range: documentation ( source)
<?php
$a = ['asd' => false];
$time = microtime();
foreach (range(1,100000) as $i) {
isset($a['asd']);
}
echo microtime() - $time;
echo "\n";
$time = microtime();
foreach (range(1,100000) as $i) {
array_key_exists('asd', $a) && !is_null($a['asd']);
}
echo microtime() - $time;