File: ArrayUtilsBench.php

package info (click to toggle)
php-zend-stdlib 3.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 908 kB
  • sloc: php: 5,005; makefile: 12; xml: 6
file content (43 lines) | stat: -rw-r--r-- 981 bytes parent folder | download | duplicates (3)
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',
        ]);
    }
}