- microtime: documentation ( source)
<?php
$isset = true;
$array = array();
$notSetArray = array(0=>'');
$string = '';
// Test Source
function TestEmpty() {
$array = array();
unset($array);
$i = 0;
/* The Test */
$t = microtime(true);
while($i < 2000) {
empty($arrday);
++$i;
}
echo (microtime(true) - $t);
}
function TestEmpty2() {
$array = array();
unset($array);
$i = 0;
/* The Test */
$t = microtime(true);
while($i < 2000) {
($array == []);
++$i;
}
echo (microtime(true) - $t);
}
function TestEmpty3() {
$array = array();
unset($array);
$i = 0;
/* The Test */
$t = microtime(true);
while($i < 2000) {
($array === []);
++$i;
}
echo (microtime(true) - $t);
}
TestEmpty();
echo '<hr>-----';
TestEmpty2();
echo '<hr>-----';
TestEmpty3();