ID: 46716 Updated by: [EMAIL PROTECTED] Reported By: iain at workingsoftware dot com dot au -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Freebsd 7.0 PHP Version: 5.2.6 New Comment:
This was recently discussed on the developers list and decided to keep the current behavior which is iterating over the object's property table Previous Comments: ------------------------------------------------------------------------ [2008-11-29 11:17:36] iain at workingsoftware dot com dot au Sorry, my desired result should have been: 0: one 1: two 2: three 0: one 1: two 2: three ------------------------------------------------------------------------ [2008-11-29 11:16:50] iain at workingsoftware dot com dot au Description: ------------ I can use an Iterator with foreach(), however if I attempt to iterate over it using list/each it does not behave as expected. Basically I'd just like to be able to treat an Iterator as I would an array. Reproduce code: --------------- sample code at: http://www.workingsoftware.com.au/iterator_test.phpt Expected result: ---------------- this is not so much expected, as desired result: 0: one 1: two 2: three Actual result: -------------- 0: one 1: two 2: three MyIteratorarr: Array ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46716&edit=1