public function process()
    {
        $operands = $this->getOperands();
        $expression = $this->getExpression();

        if ($operands->containsNull() === true) {
            return null;
        }

        if ($operands->sameCardinality() === false) {
            $msg = "The Match Expression only accepts operands with the same cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        if ($operands->sameBaseType() === false) {
            $msg = "The Match Expression only accepts operands with the same baseType.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_BASETYPE);
        }

        $firstOperand = $operands[0];
        $secondOperand = $operands[1];

        if ($operands[0] instanceof Comparable) {
            // 2 containers to compare.
            return new QtiBoolean($operands[0]->equals($operands[1]));
        } else {
            return new QtiBoolean($operands[0] === $operands[1]);
        }
    }
public function process()
    {
        $operands = $this->getOperands();
        $expression = $this->getExpression();

        if ($operands->containsNull() === true) {
            return null;
        }

        if ($operands->sameCardinality() === false) {
            $msg = "The Match Expression only accepts operands with the same cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        if ($operands->sameBaseType() === false) {
            $msg = "The Match Expression only accepts operands with the same baseType.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_BASETYPE);
        }

        $firstOperand = $operands[0];
        $secondOperand = $operands[1];

        if ($operands[0] instanceof Comparable) {
            // 2 containers to compare.
            return new QtiBoolean($operands[0]->equals($operands[1]));
        } else {
            return new QtiBoolean($operands[0] === $operands[1]);
        }
    }
public function process ( ) { $ operands = $ this -> getOperands ( ) ; $ expression = $ this -> getExpression ( ) ; if ( $ operands -> containsNull ( ) === true ) { return null ; } if ( $ operands -> sameCardinality ( ) === false ) { $ msg = "The Match Expression only accepts operands with the same cardinality." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: WRONG_CARDINALITY ) ; } if ( $ operands -> sameBaseType ( ) === false ) { $ msg = "The Match Expression only accepts operands with the same baseType." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: WRONG_BASETYPE ) ; } $ firstOperand = $ operands [ 0 ] ; $ secondOperand = $ operands [ 1 ] ; if ( $ operands [ 0 ] instanceof Comparable ) { // 2 containers to compare. return new QtiBoolean ( $ operands [ 0 ] -> equals ( $ operands [ 1 ] ) ) ; } else { return new QtiBoolean ( $ operands [ 0 ] === $ operands [ 1 ] ) ; } }
Process the Match Expression object.

@return boolean|null Whether the two expressions represent the same value or NULL if either of the sub-expressions is NULL.
@throws \qtism\runtime\expressions\operators\OperatorProcessingException
Process the Match Expression object .