- microtime: documentation ( source)
- in_array: documentation ( source)
- number_format: documentation ( source)
- md5: documentation ( source)
<?php
$i=0; $j=500000;
while($i < 60000) {
$i++; $j++;
$data1[] = md5($i);
$data2[] = md5($j);
}
$time = microtime(true);
echo "Starting array_diff\n";
$data_diff1 = in_array($data1, array(false, 'sdsdsdsd', 'sdsdasdasdasdasd'));
$time = microtime(true) - $time;
echo 'array_diff() took ' . number_format($time, 3) . ' seconds and returned ' . count($data_diff1) . " entries\n";