29 public function __construct($startOffset, $text)
32 $this->startOffset = $startOffset;
36 public function getStartOffset()
38 return $this->startOffset;
41 public function getEndOffset()
43 return $this->startOffset + strlen($this->text);
46 public function getSlice($startOffset, $endOffset = null)
48 $adjustedStartOffset =
max($startOffset - $this->startOffset, 0);
49 if (isset($endOffset)) {
50 $adjustedEndOffset =
max($endOffset - $this->startOffset, 0);
51 return substr($this->text, $adjustedStartOffset,
52 max($adjustedEndOffset - $adjustedStartOffset, 0));
54 return substr($this->text, $adjustedStartOffset);
FUNCTION int max(int permGroup, int permPublic)
Get the maximum group privilege.