ID: 37623 Updated by: [EMAIL PROTECTED] Reported By: sperson at lfdj dot com -Status: Assigned +Status: Bogus Bug Type: SPL related -Operating System: +Operating System: * -PHP Version: 5.1.4 +PHP Version: 5.* Assigned To: helly New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The notice means that foreach rewinds or moves to its end. Whatever the ArrayIterator decides. Previous Comments: ------------------------------------------------------------------------ [2006-05-29 09:48:01] [EMAIL PROTECTED] AFAICT this is intended. ------------------------------------------------------------------------ [2006-05-29 09:27:32] sperson at lfdj dot com Description: ------------ When we do a foreach on an arrayObject, and we want to unset some item from the loop a NOTICE is thrown. Don't know if this is the intended behaviour but in case of doubt I prefer to submit. Reproduce code: --------------- $coll = new ArrayObject(); $coll->append(new stdClass()); foreach ($coll as $index => $item) { $coll->offsetUnset($index); } Expected result: ---------------- nothing Actual result: -------------- Notice: main() [function.main]: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in index.php on line 7 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37623&edit=1