Can somebody explain clearly the fundamental differences between ArrayIterator
, ArrayObject
and Array
in PHP in terms of functionality and
array
is one the eight primitive types in PHP. Allthough it comes with a lot of built-in utility functions, but they are all procedural.
Both the ArrayObject
and the ArrayIterator
allow us to make arrays first class citizens in an object oriented program (OOP).
Difference between ArrayObject
and the ArrayIterator
is that, since ArrayIterator
implements SeekableIterator
interface, you can do $myArray->seek(10);
with ArrayIterator
.