public function variableOpComparison($v1, $o, $v2)
    {
        switch ($o) {
            case Operators::DIFFERENT:
                // !=
                return ($v1 != $v2);

            case Operators::SUPERIOR:
                // >
                return ($v1 > $v2);

            case Operators::SUPERIOR_OR_EQUAL:
                // >=
                return ($v1 >= $v2);

            case Operators::INFERIOR:
                // <
                return ($v1 < $v2);

            case Operators::INFERIOR_OR_EQUAL:
                // <=
                return ($v1 <= $v2);

            case Operators::EQUAL:
                // ==
                return ($v1 == $v2);

            case Operators::IN:
                // in
                return (\in_array($v1, $v2));

            case Operators::OUT:
                // not in
                return (!\in_array($v1, $v2));

            default:
                throw new \Exception('Unrecognized operator ' . $o);
        }
    }
public function variableOpComparison($v1, $o, $v2)
    {
        switch ($o) {
            case Operators::DIFFERENT:
                // !=
                return ($v1 != $v2);

            case Operators::SUPERIOR:
                // >
                return ($v1 > $v2);

            case Operators::SUPERIOR_OR_EQUAL:
                // >=
                return ($v1 >= $v2);

            case Operators::INFERIOR:
                // <
                return ($v1 < $v2);

            case Operators::INFERIOR_OR_EQUAL:
                // <=
                return ($v1 <= $v2);

            case Operators::EQUAL:
                // ==
                return ($v1 == $v2);

            case Operators::IN:
                // in
                return (\in_array($v1, $v2));

            case Operators::OUT:
                // not in
                return (!\in_array($v1, $v2));

            default:
                throw new \Exception('Unrecognized operator ' . $o);
        }
    }
public function variableOpComparison ( $ v1 , $ o , $ v2 ) { switch ( $ o ) { case Operators :: DIFFERENT : // != return ( $ v1 != $ v2 ) ; case Operators :: SUPERIOR : // > return ( $ v1 > $ v2 ) ; case Operators :: SUPERIOR_OR_EQUAL : // >= return ( $ v1 >= $ v2 ) ; case Operators :: INFERIOR : // < return ( $ v1 < $ v2 ) ; case Operators :: INFERIOR_OR_EQUAL : // <= return ( $ v1 <= $ v2 ) ; case Operators :: EQUAL : // == return ( $ v1 == $ v2 ) ; case Operators :: IN : // in return ( \ in_array ( $ v1 , $ v2 ) ) ; case Operators :: OUT : // not in return ( ! \ in_array ( $ v1 , $ v2 ) ) ; default : throw new \ Exception ( 'Unrecognized operator ' . $ o ) ; } }
Do variable comparison

@param mixed  $v1 Variable 1
@param string $o  Operator ex : Operators::DIFFERENT
@param mixed  $v2 Variable 2

@throws \Exception
@return bool
Do variable comparison