original_string: public static function isAssociativeArray($array)
      {
          reset($array);
          if (!is_numeric(key($array))
              || key($array) != 0
          ) {
              // first key must be 0
  
              return true;
          }
  
          // check that each key is == next key - 1 w/o actually indexing the array
          while (true) {
              $current = key($array);
  
              next($array);
              $next = key($array);
  
              if ($next === null) {
                  break;
              } elseif ($current + 1 != $next) {
                  return true;
              }
          }
  
          return false;
      }
code: public static function isAssociativeArray($array)
      {
          reset($array);
          if (!is_numeric(key($array))
              || key($array) != 0
          ) {
              // first key must be 0
  
              return true;
          }
  
          // check that each key is == next key - 1 w/o actually indexing the array
          while (true) {
              $current = key($array);
  
              next($array);
              $next = key($array);
  
              if ($next === null) {
                  break;
              } elseif ($current + 1 != $next) {
                  return true;
              }
          }
  
          return false;
      }
code_tokens: public static function isAssociativeArray ( $ array ) { reset ( $ array ) ; if ( ! is_numeric ( key ( $ array ) ) || key ( $ array ) != 0 ) { // first key must be 0 return true ; } // check that each key is == next key - 1 w/o actually indexing the array while ( true ) { $ current = key ( $ array ) ; next ( $ array ) ; $ next = key ( $ array ) ; if ( $ next === null ) { break ; } elseif ( $ current + 1 != $ next ) { return true ; } } return false ; }
docstring: Returns true if an array is an associative array, false if otherwise.
  
  This method determines if an array is associative by checking that the
  first element's key is 0, and that each successive element's key is
  one greater than the last.
  
  @param array $array
  @return bool
docstring_tokens: Returns true if an array is an associative array false if otherwise .