protected function compare($a, $b, $operator)
    {
        settype($a, 'array');
        settype($b, 'array');

        if (in_array($operator, array('>=', '<=', '>', '<'))) {
            $a = reset($a);
            $b = reset($b);
        }

        switch ($operator) {
            case '>=':
                return $a >= $b;
            case '<=':
                return $a <= $b;
            case '>':
                return $a > $b;
            case '<':
                return $a < $b;
            case '=':
                return count(array_intersect($a, $b)) > 0;
            case '!=':
                return count(array_intersect($a, $b)) == 0;
        }

        return false;
    }
protected function compare($a, $b, $operator)
    {
        settype($a, 'array');
        settype($b, 'array');

        if (in_array($operator, array('>=', '<=', '>', '<'))) {
            $a = reset($a);
            $b = reset($b);
        }

        switch ($operator) {
            case '>=':
                return $a >= $b;
            case '<=':
                return $a <= $b;
            case '>':
                return $a > $b;
            case '<':
                return $a < $b;
            case '=':
                return count(array_intersect($a, $b)) > 0;
            case '!=':
                return count(array_intersect($a, $b)) == 0;
        }

        return false;
    }
protected function compare ( $ a , $ b , $ operator ) { settype ( $ a , 'array' ) ; settype ( $ b , 'array' ) ; if ( in_array ( $ operator , array ( '>=' , '<=' , '>' , '<' ) ) ) { $ a = reset ( $ a ) ; $ b = reset ( $ b ) ; } switch ( $ operator ) { case '>=' : return $ a >= $ b ; case '<=' : return $ a <= $ b ; case '>' : return $ a > $ b ; case '<' : return $ a < $ b ; case '=' : return count ( array_intersect ( $ a , $ b ) ) > 0 ; case '!=' : return count ( array_intersect ( $ a , $ b ) ) == 0 ; } return false ; }
Compare two values using an operator
@param mixed $a
@param mixed $b
@param string $operator
@return boolean
Compare two values using an operator