#46716 [Opn->Bgs]: Iterator does not work with list/each constructs
| From: | johannes@php.net | Date: | Wed, 10 Dec 2008 11:48:10 +0000 |
| Subject: | #46716 [Opn->Bgs]: Iterator does not work with list/each constructs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131860@lists.php.net to get a copy of this message | ||
ID: 46716
Updated by: johannes@php.net
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