I've started to learn PHP SPL from ArrayIterators and I'd like to know what are the benefits of using SPL ArrayObject, ArrayIterator, RecursiveArrayIterator instead of regular arrays?
a) I've heard that loops using SPL iterators will reduce memory usage (but why?). I don't really know to believe this or no because I don't understand how can it reduce memory usage.
b) Talking about RecursiveArrayIterator we can say that sometimes it could save some lines of code (we're using one foreach construction instead of 2+ (depends on array dimension)).
Probably, my questions could seem to be very easy for somebody, but there are too little information/documentation about SPL.
Thank you