#46716 [NEW]: Iterator does not work with list/each constructs
| From: | iain at workingsoftware dot com dot au | Date: | Sat, 29 Nov 2008 11:16:50 +0000 |
| Subject: | #46716 [NEW]: Iterator does not work with list/each constructs | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-131479@lists.php.net to get a copy of this message | ||
From: iain at workingsoftware dot com dot au
Operating system: Freebsd 7.0
PHP version: 5.2.6
PHP Bug Type: Feature/Change Request
Bug description: Iterator does not work with list/each constructs
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 bug report at http://bugs.php.net/?id=46716&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46716&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46716&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46716&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46716&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46716&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46716&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46716&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46716&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46716&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46716&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46716&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46716&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46716&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46716&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46716&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46716&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46716&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46716&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46716&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46716&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46716&r=mysqlcfg