|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-29 09:48 UTC] mike@php.net
[2006-05-29 18:29 UTC] helly@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 11:00:01 2025 UTC |
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