why better to return Itterator than array

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

why better to return Itterator than array

Post by jmut »

Lets say we make a db query.
Why is it better our method/function to return result object which implments itterator than returning a whole array with the results.
Any pros and cons?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

this may be of good reading :)

viewtopic.php?t=54143
Post Reply