MediaWiki REL1_39
ReverseArrayIterator Class Reference

Convenience class for iterating over an array in reverse order. More...

Inheritance diagram for ReverseArrayIterator:
Collaboration diagram for ReverseArrayIterator:

Public Member Functions

 __construct ( $array=[])
 Creates an iterator which will visit the keys in $array in reverse order.
 
 count ()
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Protected Attributes

array $array
 

Detailed Description

Convenience class for iterating over an array in reverse order.

Since
1.27

Definition at line 29 of file ReverseArrayIterator.php.

Constructor & Destructor Documentation

◆ __construct()

ReverseArrayIterator::__construct ( $array = [])

Creates an iterator which will visit the keys in $array in reverse order.

If given an object, will visit the properties of the object in reverse order. (Note that the default order for PHP arrays and objects is declaration/assignment order.)

@phpcs:ignore MediaWiki.Commenting.FunctionComment.ObjectTypeHintParam

Parameters
array | object$array

Definition at line 42 of file ReverseArrayIterator.php.

References $array, and rewind().

Member Function Documentation

◆ count()

ReverseArrayIterator::count ( )

Definition at line 76 of file ReverseArrayIterator.php.

◆ current()

ReverseArrayIterator::current ( )

Definition at line 55 of file ReverseArrayIterator.php.

References current().

Referenced by current().

◆ key()

ReverseArrayIterator::key ( )

Definition at line 60 of file ReverseArrayIterator.php.

References key().

Referenced by key().

◆ next()

ReverseArrayIterator::next ( )

Definition at line 64 of file ReverseArrayIterator.php.

◆ rewind()

ReverseArrayIterator::rewind ( )

Definition at line 68 of file ReverseArrayIterator.php.

Referenced by __construct().

◆ valid()

ReverseArrayIterator::valid ( )

Definition at line 72 of file ReverseArrayIterator.php.

Member Data Documentation

◆ $array

array ReverseArrayIterator::$array
protected

Definition at line 31 of file ReverseArrayIterator.php.

Referenced by __construct().


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