protected function evaluateOperator($value, $operator, $operand)
    {
        switch ($operator) {
            case '=':
                return $value === $operand;
            case '!=':
                return $value !== $operand;
            case '<':
                return $value < $operand;
            case '<=':
                return $value <= $operand;
            case '>':
                return $value > $operand;
            case '>=':
                return $value >= $operand;
            case '$=':
                if (is_array($value)) {
                    if ($this->evaluateOperator(end($value), '=', $operand)) {
                        return true;
                    }
                    return false;
                } else {
                    return strrpos($value, (string)$operand) === strlen($value) - strlen($operand);
                }
            case '^=':
                if (is_array($value)) {
                    if ($this->evaluateOperator(reset($value), '=', $operand)) {
                        return true;
                    }
                    return false;
                } else {
                    return strpos($value, (string)$operand) === 0;
                }
            case '*=':
                if (is_array($value)) {
                    foreach ($value as $item) {
                        if ($this->evaluateOperator($item, '=', $operand)) {
                            return true;
                        }
                    }
                    return false;
                } else {
                    return strpos($value, (string)$operand) !== false;
                }
            case 'instanceof':
                if ($this->operandIsSimpleType($operand)) {
                    return $this->handleSimpleTypeOperand($operand, $value);
                } else {
                    return ($value instanceof $operand);
                }
            case '!instanceof':
                if ($this->operandIsSimpleType($operand)) {
                    return !$this->handleSimpleTypeOperand($operand, $value);
                } else {
                    return !($value instanceof $operand);
                }
            default:
                return ($value !== null);
        }
    }
protected function evaluateOperator($value, $operator, $operand)
    {
        switch ($operator) {
            case '=':
                return $value === $operand;
            case '!=':
                return $value !== $operand;
            case '<':
                return $value < $operand;
            case '<=':
                return $value <= $operand;
            case '>':
                return $value > $operand;
            case '>=':
                return $value >= $operand;
            case '$=':
                if (is_array($value)) {
                    if ($this->evaluateOperator(end($value), '=', $operand)) {
                        return true;
                    }
                    return false;
                } else {
                    return strrpos($value, (string)$operand) === strlen($value) - strlen($operand);
                }
            case '^=':
                if (is_array($value)) {
                    if ($this->evaluateOperator(reset($value), '=', $operand)) {
                        return true;
                    }
                    return false;
                } else {
                    return strpos($value, (string)$operand) === 0;
                }
            case '*=':
                if (is_array($value)) {
                    foreach ($value as $item) {
                        if ($this->evaluateOperator($item, '=', $operand)) {
                            return true;
                        }
                    }
                    return false;
                } else {
                    return strpos($value, (string)$operand) !== false;
                }
            case 'instanceof':
                if ($this->operandIsSimpleType($operand)) {
                    return $this->handleSimpleTypeOperand($operand, $value);
                } else {
                    return ($value instanceof $operand);
                }
            case '!instanceof':
                if ($this->operandIsSimpleType($operand)) {
                    return !$this->handleSimpleTypeOperand($operand, $value);
                } else {
                    return !($value instanceof $operand);
                }
            default:
                return ($value !== null);
        }
    }
protected function evaluateOperator ( $ value , $ operator , $ operand ) { switch ( $ operator ) { case '=' : return $ value === $ operand ; case '!=' : return $ value !== $ operand ; case '<' : return $ value < $ operand ; case '<=' : return $ value <= $ operand ; case '>' : return $ value > $ operand ; case '>=' : return $ value >= $ operand ; case '$=' : if ( is_array ( $ value ) ) { if ( $ this -> evaluateOperator ( end ( $ value ) , '=' , $ operand ) ) { return true ; } return false ; } else { return strrpos ( $ value , ( string ) $ operand ) === strlen ( $ value ) - strlen ( $ operand ) ; } case '^=' : if ( is_array ( $ value ) ) { if ( $ this -> evaluateOperator ( reset ( $ value ) , '=' , $ operand ) ) { return true ; } return false ; } else { return strpos ( $ value , ( string ) $ operand ) === 0 ; } case '*=' : if ( is_array ( $ value ) ) { foreach ( $ value as $ item ) { if ( $ this -> evaluateOperator ( $ item , '=' , $ operand ) ) { return true ; } } return false ; } else { return strpos ( $ value , ( string ) $ operand ) !== false ; } case 'instanceof' : if ( $ this -> operandIsSimpleType ( $ operand ) ) { return $ this -> handleSimpleTypeOperand ( $ operand , $ value ) ; } else { return ( $ value instanceof $ operand ) ; } case '!instanceof' : if ( $ this -> operandIsSimpleType ( $ operand ) ) { return ! $ this -> handleSimpleTypeOperand ( $ operand , $ value ) ; } else { return ! ( $ value instanceof $ operand ) ; } default : return ( $ value !== null ) ; } }
Evaluate an operator

@param mixed $value
@param string $operator
@param mixed $operand
@return boolean
Evaluate an operator