- microtime: documentation ( source)
- count: documentation ( source)
<?php
namespace A\B;
$a = [['x'], ['y'], ['z1'], 1, 2, 3, 4, 5, 'some text'];
$time = microtime(true);
for ($i=0; $i<1000000; $i++) {
\count($a);
}
echo (microtime(true) - $time) . "\n";
$time = microtime(true);
for ($i=0; $i<1000000; $i++) {
count($a);
}
echo (microtime(true) - $time) . "\n";