1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
<?php
/**
* @see https://github.com/laminas/laminas-stdlib for the canonical source repository
* @copyright https://github.com/laminas/laminas-stdlib/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-stdlib/blob/master/LICENSE.md New BSD License
*/
namespace LaminasBench\Stdlib;
use Laminas\Stdlib\ArrayUtils;
use PhpBench\Benchmark\Metadata\Annotations\Iterations;
use PhpBench\Benchmark\Metadata\Annotations\Revs;
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
/**
* @Revs(1000)
* @Iterations(10)
* @Warmup(2)
*/
class ArrayUtilsBench
{
public function benchHasStringKeys()
{
ArrayUtils::hasStringKeys([
'key' => 'value',
]);
}
public function benchHasIntegerKeys()
{
ArrayUtils::hasIntegerKeys([
1 => 'value',
]);
}
public function benchHasNumericKeys()
{
ArrayUtils::hasNumericKeys([
'1' => 'value',
]);
}
}
|