OrderedHashMap

OrderedHashMap

class OrderedHashMap implements ArrayAccess, IteratorAggregate, Countable

A hash map which keeps track of deletions and additions.

Like in associative arrays, elements can be mapped to integer or string keys. Unlike associative arrays, the map keeps track of the order in which keys were added and removed. This order is reflected during iteration.

The map supports concurrent modification during iteration. That means that you can insert and remove elements from within a foreach loop and the iterator will reflect those changes accordingly.

While elements that are added during the l