private static function doOperation( $token, $left, $right ) {
		if ( in_array( $token, [ 'in', 'not-in', 'within', 'not-within' ] ) ) {
			if ( !$right instanceof Range ) {
				$right = new Range( $right );
			}
		}
		switch ( $token ) {
			case 'or':
				return $left || $right;
			case 'and':
				return $left && $right;
			case 'is':
				return $left == $right;
			case 'is-not':
				return $left != $right;
			case 'in':
				return $right->isNumberIn( $left );
			case 'not-in':
				return !$right->isNumberIn( $left );
			case 'within':
				return $right->isNumberWithin( $left );
			case 'not-within':
				return !$right->isNumberWithin( $left );
			case 'mod':
				if ( is_int( $left ) ) {
					return (int)fmod( $left, $right );
				}

				return fmod( $left, $right );
			case ',':
				if ( $left instanceof Range ) {
					$range = $left;
				} else {
					$range = new Range( $left );
				}
				$range->add( $right );

				return $range;
			case '..':
				return new Range( $left, $right );
			default:
				throw new Error( "Invalid RPN token" );
		}
	}