- microtime: documentation ( source)
- error_reporting: documentation ( source)
- define: documentation ( source)
<?php
error_reporting(E_ALL | E_STRICT);
define('ITERATIONS', 2000000);
function foo($a) {
return;
}
$start = microtime(true);
for ($i=0; $i < ITERATIONS; ++$i) {
foo(1);
}
$stop = microtime(true);
echo "Test name: " . ($stop - $start) . " seconds". PHP_EOL;