|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-14 09:18 UTC] degeberg@php.net
[2010-05-14 09:18 UTC] degeberg@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: degeberg
[2010-05-14 09:18 UTC] degeberg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 09:00:02 2026 UTC |
Description: ------------ The sole argument for the ArrayIterator::append method is listed as a string; however, I have successfully used this method to add arbitrary objects to an ArrayIterator. Test script: --------------- <?php $ai=new ArrayIterator(); $obj=new stdClass; $obj->a=1; $ai->append($obj); echo 'count() == '. $ai->count() .'<br />'; while($ai->valid()) { echo 'Object '.$ai->key() .'->a == '. $ai->current()->a.'<br />'; $ai->next(); } ?> Expected result: ---------------- count() == 1 Object 0->a == 1