original_string: public static function countMaxDepthIterative(array $array)
      {
          $copy     = $array;
          $maxDepth = 1;
  
          foreach ($copy as $element) {
              $depth = 1;
              while (!empty($element)) {
                  if (is_array($element)) {
                      ++$depth;
                      $tmp = array_shift($element);
                      if (is_array($tmp)) {
                          array_push($element, array_shift($tmp));
                      }
                  } else {
                      break;
                  }
              }
              if ($depth > $maxDepth) {
                  $maxDepth = $depth;
              }
          }
  
          return $maxDepth;
      }
code: public static function countMaxDepthIterative(array $array)
      {
          $copy     = $array;
          $maxDepth = 1;
  
          foreach ($copy as $element) {
              $depth = 1;
              while (!empty($element)) {
                  if (is_array($element)) {
                      ++$depth;
                      $tmp = array_shift($element);
                      if (is_array($tmp)) {
                          array_push($element, array_shift($tmp));
                      }
                  } else {
                      break;
                  }
              }
              if ($depth > $maxDepth) {
                  $maxDepth = $depth;
              }
          }
  
          return $maxDepth;
      }
code_tokens: public static function countMaxDepthIterative ( array $ array ) { $ copy = $ array ; $ maxDepth = 1 ; foreach ( $ copy as $ element ) { $ depth = 1 ; while ( ! empty ( $ element ) ) { if ( is_array ( $ element ) ) { ++ $ depth ; $ tmp = array_shift ( $ element ) ; if ( is_array ( $ tmp ) ) { array_push ( $ element , array_shift ( $ tmp ) ) ; } } else { break ; } } if ( $ depth > $ maxDepth ) { $ maxDepth = $ depth ; } } return $ maxDepth ; }
docstring: Counts maximum array depth iteratively
  
  @param array $array
  
  @return int
docstring_tokens: Counts maximum array depth iteratively