examples/ratelimit/ratelimit.php
public function incrementAndGetCountByInterval($subject, $interval) {
		$bucket = $this->_getBucketName();
		$count = (int) floor($interval / $this->_bucketInterval);
		$transaction = $this->_getTransaction();
		$this->_setMultiIncrementTransactionPart($transaction, $subject, $bucket);
		$this->_setMulitExecGetCountPart($transaction, $subject, $bucket, $count);

		return array_sum(array_slice($transaction->execute(), 4));
	}
public function incrementAndGetCountByInterval($subject, $interval) {
		$bucket = $this->_getBucketName();
		$count = (int) floor($interval / $this->_bucketInterval);
		$transaction = $this->_getTransaction();
		$this->_setMultiIncrementTransactionPart($transaction, $subject, $bucket);
		$this->_setMulitExecGetCountPart($transaction, $subject, $bucket, $count);

		return array_sum(array_slice($transaction->execute(), 4));
	}
Calls the increment() and count() function using a single MULTI/EXEC block.

@param string $subject A unique identifier, for example a session id or an IP
@param int $interval Interval in seconds
@return int