Пример #1
0
function BenchmarkXarrayIndexed(Benchmark $b)
{
    $index = makeIndexedArray(ARRSIZE);
    $assoc = makeAssocArray(ARRSIZE);
    $mixed = makeMixedArray(HALFSIZE);
    $b->resetTimer();
    for ($i = 0; $i < $b->N(); $i++) {
        array_is_indexed($index);
        array_is_indexed($assoc);
        array_is_indexed($mixed);
    }
}
Пример #2
0
 /**
  * @param array|string|IConfig $config
  *
  * @throws InvalidRuntimeConfigException
  *
  * @return IConfigLoader
  */
 public function addConfig($config)
 {
     if (is_array($config)) {
         // array of paths to config files
         if (array_is_indexed($config)) {
             $this->addPaths($config);
         } else {
             $this->addRuntimeConfig($config);
         }
     } else {
         if (is_string($config)) {
             $this->addPath($config);
         } else {
             if ($config instanceof IConfig) {
                 $this->addRuntimeConfig($config);
             }
         }
     }
     return $this;
 }
Пример #3
0
 /**
  * @dataProvider array_is_index_provider
  */
 public function test_array_is_indexed($expected, $array)
 {
     $this->assertEquals($expected, array_is_indexed($array));
 }