This is a PHP collection implementation.
Collections and arrays are similar in that they both hold references to objects and they can be managed as a group.
The advantage in using collections is that the objects in a collection can represent specific structures (classes/interfaces) instead of having an array where developers have to guess what is inside.
public function getAllCats(AnimalCollection $animals):CatCollection
{
/** ... **/
}
This implementation covers the interfaces Countable, Iterator and ArrayAccess.