Lines Matching refs:offset
354 * @param int $offset Alternate place from which to start the
363 $offset = 0, argument
377 $offset = strlen(mb_substr($this->_string, 0, $offset));
385 $offset
389 return preg_match($pattern, $this->_string, $matches, $flags, $offset);
611 * @param int $offset Offset.
614 protected function computeOffset($offset) argument
618 if (0 > $offset) {
619 $offset = -$offset % $length;
621 if (0 !== $offset) {
622 $offset = $length - $offset;
624 } elseif ($offset >= $length) {
625 $offset %= $length;
628 return $offset;
634 * @param int $offset Offset (can be negative and unbound).
637 public function offsetGet($offset) argument
639 return mb_substr($this->_string, $this->computeOffset($offset), 1);
645 * @param int $offset Offset (can be negative and unbound).
649 public function offsetSet($offset, $value) argument
652 $offset = $this->computeOffset($offset);
654 if (0 < $offset) {
655 $head = mb_substr($this->_string, 0, $offset);
658 $tail = mb_substr($this->_string, $offset + 1);
668 * @param int $offset Offset (can be negative and unbound).
671 public function offsetUnset($offset) argument
673 return $this->offsetSet($offset, null);
681 public function offsetExists($offset) argument
713 * @param int $offset Offset (can be negative and unbound).
716 public function getByteAt($offset) argument
720 if (0 > $offset) {
721 $offset = -$offset % $length;
723 if (0 !== $offset) {
724 $offset = $length - $offset;
726 } elseif ($offset >= $length) {
727 $offset %= $length;
730 return $this->_string[$offset];