- microtime: documentation ( source)
- function_exists: documentation ( source)
- extension_loaded: documentation ( source)
<?php
$start = microtime(true);
for($i = 1; $i <= 10000; $i++) {
if(function_exists('mcrypt_encrypt')) {
echo "y";
} else {
echo "n";
}
}
$end = microtime(true);
echo PHP_EOL."function_exists: ".($end - $start)."ms".PHP_EOL;
$start = microtime(true);
for($i = 1; $i <= 10000; $i++) {
if(extension_loaded('mcrypt')) {
echo "y";
} else {
echo "n";
}
}
$end = microtime(true);
echo PHP_EOL."extension_loaded: ".($end - $start)."ms";
This script was stopped while abusing our resources