8000 add ArrayUtils benchmark · zendframework/zend-stdlib@de1dbbf · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit de1dbbf

Browse files
committed
add ArrayUtils benchmark
1 parent f04a124 commit de1dbbf

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

benchmark/ArrayUtilsBench.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Zend Framework (http://framework.zend.com/)
4+
*
5+
* @link http://github.com/zendframework/zf2 for the canonical source repository
6+
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7+
* @license http://framework.zend.com/license/new-bsd New BSD License
8+
*/
9+
10+
namespace ZendBench\Stdlib;
11+
12+
use PhpBench\Benchmark\Metadata\Annotations\Iterations;
13+
use PhpBench\Benchmark\Metadata\Annotations\Revs;
14+
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
15+
use Zend\Stdlib\ArrayUtils;
16+
17+
/**
18+
* @Revs(1000)
19+
* @Iterations(10)
20+
* @Warmup(2)
21+
*/
22+
class ArrayUtilsBench
23+
{
24+
public function benchHasStringKeys()
25+
{
26+
ArrayUtils::hasStringKeys([
27+
'key' => 'value',
28+
]);
29+
}
30+
31+
public function benchHasIntegerKeys()
32+
{
33+
ArrayUtils::hasIntegerKeys([
34+
1 => 'value',
35+
]);
36+
}
37+
38+
public function benchHasNumericKeys()
39+
{
40+
ArrayUtils::hasNumericKeys([
41+
'1' => 'value',
42+
]);
43+
}
44+
}

0 commit comments

Comments
 (0)
0