MediaWiki REL1_35
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 rewind().

Member Function Documentation

◆ current()

ExplodeIterator::current ( )
Returns
string|false

Definition at line 84 of file ExplodeIterator.php.

◆ key()

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

Definition at line 92 of file ExplodeIterator.php.

◆ next()

ExplodeIterator::next ( )
Returns
void

Definition at line 99 of file ExplodeIterator.php.

◆ refreshCurrent()

ExplodeIterator::refreshCurrent ( )

Definition at line 68 of file ExplodeIterator.php.

◆ rewind()

ExplodeIterator::rewind ( )

Definition at line 62 of file ExplodeIterator.php.

Referenced by __construct().

◆ valid()

ExplodeIterator::valid ( )
Returns
bool

Definition at line 116 of file ExplodeIterator.php.

Member Data Documentation

◆ $curPos

ExplodeIterator::$curPos
private

Definition at line 38 of file ExplodeIterator.php.

◆ $current

string false ExplodeIterator::$current
private

The current token.

Definition at line 44 of file ExplodeIterator.php.

◆ $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.

◆ $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: