isNumericArray() public static method

For performance reason, this method checks the first array index only. More thorough inspection of the array might be needed. Note: Returns true for empty arrays to preserve compatibility with empty lists.
public static isNumericArray ( array $array ) : boolean
$array array
return boolean
 /**
  * @link http://www.php.net/manual/en/mongocollection.aggregate.php
  * @param array $pipeline
  * @param array $op
  * @return array
  */
 public function aggregate(array $pipeline, array $op = [])
 {
     if (!TypeConverter::isNumericArray($pipeline)) {
         $pipeline = [];
         $options = [];
         $i = 0;
         foreach (func_get_args() as $operator) {
             $i++;
             if (!is_array($operator)) {
                 trigger_error("Argument {$i} is not an array", E_WARNING);
                 return;
             }
             $pipeline[] = $operator;
         }
     } else {
         $options = $op;
     }
     $command = ['aggregate' => $this->name, 'pipeline' => $pipeline];
     $command += $options;
     return $this->db->command($command, [], $hash);
 }
 /**
  * Perform an aggregation using the aggregation framework
  *
  * @link http://www.php.net/manual/en/mongocollection.aggregate.php
  * @param array $pipeline
  * @param array $op
  * @return array
  */
 public function aggregate(array $pipeline, array $op = [])
 {
     if (!TypeConverter::isNumericArray($pipeline)) {
         $pipeline = [];
         $options = [];
         $i = 0;
         foreach (func_get_args() as $operator) {
             $i++;
             if (!is_array($operator)) {
                 trigger_error("Argument {$i} is not an array", E_WARNING);
                 return;
             }
             $pipeline[] = $operator;
         }
     } else {
         $options = $op;
     }
     $command = ['aggregate' => $this->name, 'pipeline' => $pipeline];
     $command += $options;
     try {
         return $this->db->command($command);
     } catch (MongoCursorTimeoutException $e) {
         throw new MongoExecutionTimeoutException($e->getMessage(), $e->getCode(), $e);
     }
 }
 /**
  * Perform an aggregation using the aggregation framework
  *
  * @link http://www.php.net/manual/en/mongocollection.aggregate.php
  * @param array $pipeline
  * @param array $op
  * @return array
  */
 public function aggregate(array $pipeline, array $op = [])
 {
     if (!TypeConverter::isNumericArray($pipeline)) {
         $operators = func_get_args();
         $pipeline = [];
         $options = [];
         $i = 0;
         foreach ($operators as $operator) {
             $i++;
             if (!is_array($operator)) {
                 trigger_error("Argument {$i} is not an array", E_WARNING);
                 return;
             }
             $pipeline[] = $operator;
         }
     } else {
         $options = $op;
     }
     if (isset($options['cursor'])) {
         $options['useCursor'] = true;
         if (isset($options['cursor']['batchSize'])) {
             $options['batchSize'] = $options['cursor']['batchSize'];
         }
         unset($options['cursor']);
     } else {
         $options['useCursor'] = false;
     }
     try {
         $cursor = $this->collection->aggregate(TypeConverter::fromLegacy($pipeline), $options);
         return ['ok' => 1.0, 'result' => TypeConverter::toLegacy($cursor), 'waitedMS' => 0];
     } catch (\MongoDB\Driver\Exception\Exception $e) {
         throw ExceptionConverter::toLegacy($e, 'MongoResultException');
     }
 }