Automattic\WooCommerce\Admin\RemoteInboxNotifications
ComparisonOperation::compare()
Compare two operands using the specified operation.
Метод класса: ComparisonOperation{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$result = ComparisonOperation::compare( $left_operand, $right_operand, $operation );
- $left_operand(объект) (обязательный)
- The left hand operand.
- $right_operand(объект) (обязательный)
- The right hand operand.
- $operation(строка) (обязательный)
- The operation used to compare the operands.
Код ComparisonOperation::compare() ComparisonOperation::compare WC 7.3.0
public static function compare( $left_operand, $right_operand, $operation ) { switch ( $operation ) { case '=': return $left_operand === $right_operand; case '<': return $left_operand < $right_operand; case '<=': return $left_operand <= $right_operand; case '>': return $left_operand > $right_operand; case '>=': return $left_operand >= $right_operand; case '!=': return $left_operand !== $right_operand; case 'contains': return in_array( $right_operand, $left_operand, true ); case '!contains': return ! in_array( $right_operand, $left_operand, true ); } return false; }