56 $this->subjectLength = strlen(
$subject );
57 $this->delimLength = strlen(
$delim );
64 $this->endPos = strpos( $this->subject, $this->delim );
69 if ( $this->curPos ===
false ) {
71 } elseif ( $this->curPos >= $this->subjectLength ) {
73 } elseif ( $this->endPos ===
false ) {
74 $this->
current = substr( $this->subject, $this->curPos );
76 $this->
current = substr( $this->subject, $this->curPos, $this->endPos - $this->curPos );
87 public function key() {
95 if ( $this->endPos ===
false ) {
96 $this->curPos =
false;
99 if ( $this->curPos >= $this->subjectLength ) {
100 $this->endPos =
false;
102 $this->endPos = strpos( $this->subject, $this->delim, $this->curPos );
114 return $this->curPos !==
false;