protected function op_number_number($op, $left, $right)
    {
        $unit = empty($left[2]) ? $right[2] : $left[2];

        $value = 0;
        switch ($op) {
        case '+':
            $value = $left[1] + $right[1];
            break;
        case '*':
            $value = $left[1] * $right[1];
            break;
        case '-':
            $value = $left[1] - $right[1];
            break;
        case '%':
            $value = $left[1] % $right[1];
            break;
        case '/':
            if ($right[1] == 0) {
                $this->throwError('parse error: divide by zero');
            }
            $value = $left[1] / $right[1];
            break;
        case '<':
            return $this->toBool($left[1] < $right[1]);
        case '>':
            return $this->toBool($left[1] > $right[1]);
        case '>=':
            return $this->toBool($left[1] >= $right[1]);
        case '=<':
            return $this->toBool($left[1] <= $right[1]);
        default:
            $this->throwError('parse error: unknown number operator: '.$op);
        }

        return array('number', $value, $unit);
    }
protected function op_number_number($op, $left, $right)
    {
        $unit = empty($left[2]) ? $right[2] : $left[2];

        $value = 0;
        switch ($op) {
        case '+':
            $value = $left[1] + $right[1];
            break;
        case '*':
            $value = $left[1] * $right[1];
            break;
        case '-':
            $value = $left[1] - $right[1];
            break;
        case '%':
            $value = $left[1] % $right[1];
            break;
        case '/':
            if ($right[1] == 0) {
                $this->throwError('parse error: divide by zero');
            }
            $value = $left[1] / $right[1];
            break;
        case '<':
            return $this->toBool($left[1] < $right[1]);
        case '>':
            return $this->toBool($left[1] > $right[1]);
        case '>=':
            return $this->toBool($left[1] >= $right[1]);
        case '=<':
            return $this->toBool($left[1] <= $right[1]);
        default:
            $this->throwError('parse error: unknown number operator: '.$op);
        }

        return array('number', $value, $unit);
    }
protected function op_number_number ( $ op , $ left , $ right ) { $ unit = empty ( $ left [ 2 ] ) ? $ right [ 2 ] : $ left [ 2 ] ; $ value = 0 ; switch ( $ op ) { case '+' : $ value = $ left [ 1 ] + $ right [ 1 ] ; break ; case '*' : $ value = $ left [ 1 ] * $ right [ 1 ] ; break ; case '-' : $ value = $ left [ 1 ] - $ right [ 1 ] ; break ; case '%' : $ value = $ left [ 1 ] % $ right [ 1 ] ; break ; case '/' : if ( $ right [ 1 ] == 0 ) { $ this -> throwError ( 'parse error: divide by zero' ) ; } $ value = $ left [ 1 ] / $ right [ 1 ] ; break ; case '<' : return $ this -> toBool ( $ left [ 1 ] < $ right [ 1 ] ) ; case '>' : return $ this -> toBool ( $ left [ 1 ] > $ right [ 1 ] ) ; case '>=' : return $ this -> toBool ( $ left [ 1 ] >= $ right [ 1 ] ) ; case '=<' : return $ this -> toBool ( $ left [ 1 ] <= $ right [ 1 ] ) ; default : $ this -> throwError ( 'parse error: unknown number operator: ' . $ op ) ; } return array ( 'number' , $ value , $ unit ) ; }
operator on two numbers
operator on two numbers