#46716 [Opn]: Iterator does not work with list/each constructs
ID: 46716
User updated by: iain at workingsoftware dot com dot au
Reported By: iain at workingsoftware dot com dot au
Status: Open
Bug Type: Feature/Change Request
Operating System: Freebsd 7.0
PHP Version: 5.2.6
New Comment:
Sorry, my desired result should have been:
0: one
1: two
2: three
0: one
1: two
2: three
Previous Comments:
------------------------------------------------------------------------
[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
Thread (4 messages)