$value ) { // Check for non-existing values. if ( ! isset( $array2[ $key ] ) ) { return true; } if ( is_array( $value ) ) { if ( $this->arraysDifferent( $value, $array2[ $key ] ) ) { return true; }; } else { if ( $value !== $array2[ $key ] ) { return true; } } } return false; } /** * Checks whether the given array is associative. * Arrays that only have consecutive, sequential numeric keys are numeric. * Otherwise they are associative. * * @since 4.1.4 * * @param array $array The array. * @return bool Whether the array is associative. */ public function isArrayAssociative( $array ) { return 0 < count( array_filter( array_keys( $array ), 'is_string' ) ); } /** * Checks whether the given array is numeric. * * @since 4.1.4 * * @param array $array The array. * @return bool Whether the array is numeric. */ public function isArrayNumeric( $array ) { return ! $this->isArrayAssociative( $array ); } }