diff --git a/language/oop5/iterations.xml b/language/oop5/iterations.xml index 7bc42729c1..46906aec94 100644 --- a/language/oop5/iterations.xml +++ b/language/oop5/iterations.xml @@ -65,13 +65,15 @@ private => private var - As the output shows, the &foreach; iterated through all - visible variables that can be - accessed. To take it a step further you can implement one - of PHP 5's internal interface named - Iterator. This allows the object to decide what and how - the object will be iterated. + As the output shows, the &foreach; iterated through all of the + visible properties that could be + accessed. + + + To take it a step further, the Iterator + interface may be implemented. + This allows the object to dictate how it will be iterated and what values will + be available on each iteration. @@ -162,9 +164,14 @@ valid: - You can also define your class so that it doesn't have to define - all the Iterator functions by simply implementing - the PHP 5 IteratorAggregate interface. + The IteratorAggregate + interface + can be used as an alternative to implementing all of the + Iterator methods. + IteratorAggregate only requires the + implementation of a single method, + IteratorAggregate::getIterator, which should return + an instance of a class implementing Iterator.