packages/kirki-framework/core/src/Helper.php
public static function compare_values( $value1, $value2, $operator ) {
		if ( '===' === $operator ) {
			return $value1 === $value2;
		}
		if ( '!==' === $operator ) {
			return $value1 !== $value2;
		}
		if ( ( '!=' === $operator || 'not equal' === $operator ) ) {
			return $value1 != $value2; // phpcs:ignore WordPress.PHP.StrictComparisons
		}
		if ( ( '>=' === $operator || 'greater or equal' === $operator || 'equal or greater' === $operator ) ) {
			return $value2 >= $value1;
		}
		if ( ( '<=' === $operator || 'smaller or equal' === $operator || 'equal or smaller' === $operator ) ) {
			return $value2 <= $value1;
		}
		if ( ( '>' === $operator || 'greater' === $operator ) ) {
			return $value2 > $value1;
		}
		if ( ( '<' === $operator || 'smaller' === $operator ) ) {
			return $value2 < $value1;
		}
		if ( 'contains' === $operator || 'in' === $operator ) {
			if ( is_array( $value1 ) && is_array( $value2 ) ) {
				foreach ( $value2 as $val ) {
					if ( in_array( $val, $value1 ) ) { // phpcs:ignore WordPress.PHP.StrictInArray
						return true;
					}
				}
				return false;
			}
			if ( is_array( $value1 ) && ! is_array( $value2 ) ) {
				return in_array( $value2, $value1 ); // phpcs:ignore WordPress.PHP.StrictInArray
			}
			if ( is_array( $value2 ) && ! is_array( $value1 ) ) {
				return in_array( $value1, $value2 ); // phpcs:ignore WordPress.PHP.StrictInArray
			}
			return ( false !== strrpos( $value1, $value2 ) || false !== strpos( $value2, $value1 ) );
		}
		return $value1 == $value2; // phpcs:ignore WordPress.PHP.StrictComparisons
	}
public static function compare_values( $value1, $value2, $operator ) {
		if ( '===' === $operator ) {
			return $value1 === $value2;
		}
		if ( '!==' === $operator ) {
			return $value1 !== $value2;
		}
		if ( ( '!=' === $operator || 'not equal' === $operator ) ) {
			return $value1 != $value2; // phpcs:ignore WordPress.PHP.StrictComparisons
		}
		if ( ( '>=' === $operator || 'greater or equal' === $operator || 'equal or greater' === $operator ) ) {
			return $value2 >= $value1;
		}
		if ( ( '<=' === $operator || 'smaller or equal' === $operator || 'equal or smaller' === $operator ) ) {
			return $value2 <= $value1;
		}
		if ( ( '>' === $operator || 'greater' === $operator ) ) {
			return $value2 > $value1;
		}
		if ( ( '<' === $operator || 'smaller' === $operator ) ) {
			return $value2 < $value1;
		}
		if ( 'contains' === $operator || 'in' === $operator ) {
			if ( is_array( $value1 ) && is_array( $value2 ) ) {
				foreach ( $value2 as $val ) {
					if ( in_array( $val, $value1 ) ) { // phpcs:ignore WordPress.PHP.StrictInArray
						return true;
					}
				}
				return false;
			}
			if ( is_array( $value1 ) && ! is_array( $value2 ) ) {
				return in_array( $value2, $value1 ); // phpcs:ignore WordPress.PHP.StrictInArray
			}
			if ( is_array( $value2 ) && ! is_array( $value1 ) ) {
				return in_array( $value1, $value2 ); // phpcs:ignore WordPress.PHP.StrictInArray
			}
			return ( false !== strrpos( $value1, $value2 ) || false !== strpos( $value2, $value1 ) );
		}
		return $value1 == $value2; // phpcs:ignore WordPress.PHP.StrictComparisons
	}
public static function compare_values ( $ value1 , $ value2 , $ operator ) { if ( '===' === $ operator ) { return $ value1 === $ value2 ; } if ( '!==' === $ operator ) { return $ value1 !== $ value2 ; } if ( ( '!=' === $ operator || 'not equal' === $ operator ) ) { return $ value1 != $ value2 ; // phpcs:ignore WordPress.PHP.StrictComparisons } if ( ( '>=' === $ operator || 'greater or equal' === $ operator || 'equal or greater' === $ operator ) ) { return $ value2 >= $ value1 ; } if ( ( '<=' === $ operator || 'smaller or equal' === $ operator || 'equal or smaller' === $ operator ) ) { return $ value2 <= $ value1 ; } if ( ( '>' === $ operator || 'greater' === $ operator ) ) { return $ value2 > $ value1 ; } if ( ( '<' === $ operator || 'smaller' === $ operator ) ) { return $ value2 < $ value1 ; } if ( 'contains' === $ operator || 'in' === $ operator ) { if ( is_array ( $ value1 ) && is_array ( $ value2 ) ) { foreach ( $ value2 as $ val ) { if ( in_array ( $ val , $ value1 ) ) { // phpcs:ignore WordPress.PHP.StrictInArray return true ; } } return false ; } if ( is_array ( $ value1 ) && ! is_array ( $ value2 ) ) { return in_array ( $ value2 , $ value1 ) ; // phpcs:ignore WordPress.PHP.StrictInArray } if ( is_array ( $ value2 ) && ! is_array ( $ value1 ) ) { return in_array ( $ value1 , $ value2 ) ; // phpcs:ignore WordPress.PHP.StrictInArray } return ( false !== strrpos ( $ value1 , $ value2 ) || false !== strpos ( $ value2 , $ value1 ) ) ; } return $ value1 == $ value2 ; // phpcs:ignore WordPress.PHP.StrictComparisons }
Compares the 2 values given the condition

@param mixed  $value1   The 1st value in the comparison.
@param mixed  $value2   The 2nd value in the comparison.
@param string $operator The operator we'll use for the comparison.
@return boolean whether The comparison has succeded (true) or failed (false).
Compares the 2 values given the condition