MediaWiki REL1_33
ExplodeIterator Class Reference

An iterator which works exactly like: More...

Inheritance diagram for ExplodeIterator:
Collaboration diagram for ExplodeIterator:

Public Member Functions

 __construct ( $delim, $subject)
 Construct a DelimIterator.
 
 current ()
 
 key ()
 
 next ()
 
 refreshCurrent ()
 
 rewind ()
 
 valid ()
 

Private Attributes

 $curPos
 
string false $current
 The current token.
 
 $delim
 
 $delimLength
 
 $endPos
 
 $subject
 
 $subjectLength
 

Detailed Description

An iterator which works exactly like:

foreach ( explode( $delim, $s ) as $element ) { ... }

Except it doesn't use 193 byte per element

Definition at line 30 of file ExplodeIterator.php.

Constructor & Destructor Documentation

◆ __construct()

ExplodeIterator::__construct ( $delim,
$subject )

Construct a DelimIterator.

Parameters
string$delim
string$subject

Definition at line 51 of file ExplodeIterator.php.

References $delim, $subject, and(), and rewind().

Member Function Documentation

◆ current()

ExplodeIterator::current ( )

Definition at line 80 of file ExplodeIterator.php.

References $current.

◆ key()

ExplodeIterator::key ( )
Returns
int|bool Current position or boolean false if invalid

Definition at line 87 of file ExplodeIterator.php.

References $curPos.

◆ next()

ExplodeIterator::next ( )
Returns
string

Definition at line 94 of file ExplodeIterator.php.

References $current, $delimLength, and(), and refreshCurrent().

◆ refreshCurrent()

ExplodeIterator::refreshCurrent ( )

Definition at line 68 of file ExplodeIterator.php.

References and().

Referenced by next(), and rewind().

◆ rewind()

ExplodeIterator::rewind ( )

Definition at line 62 of file ExplodeIterator.php.

References and(), and refreshCurrent().

Referenced by __construct().

◆ valid()

ExplodeIterator::valid ( )
Returns
bool

Definition at line 113 of file ExplodeIterator.php.

Member Data Documentation

◆ $curPos

ExplodeIterator::$curPos
private

Definition at line 38 of file ExplodeIterator.php.

Referenced by key().

◆ $current

string false ExplodeIterator::$current
private

The current token.

Definition at line 44 of file ExplodeIterator.php.

Referenced by current(), and next().

◆ $delim

ExplodeIterator::$delim
private

Definition at line 35 of file ExplodeIterator.php.

Referenced by __construct().

◆ $delimLength

ExplodeIterator::$delimLength
private

Definition at line 35 of file ExplodeIterator.php.

Referenced by next().

◆ $endPos

ExplodeIterator::$endPos
private

Definition at line 41 of file ExplodeIterator.php.

◆ $subject

ExplodeIterator::$subject
private

Definition at line 32 of file ExplodeIterator.php.

Referenced by __construct().

◆ $subjectLength

ExplodeIterator::$subjectLength
private

Definition at line 32 of file ExplodeIterator.php.


The documentation for this class was generated from the following file: