php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51814 ArrayIterator::append arguments are listed incorrectly
Submitted: 2010-05-13 22:08 UTC Modified: 2010-05-14 09:18 UTC
From: jarett dot millard at gmail dot com Assigned: degeberg (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.2 OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jarett dot millard at gmail dot com
New email:
PHP Version: OS:

 

 [2010-05-13 22:08 UTC] jarett dot millard at gmail dot com
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-14 09:18 UTC] degeberg@php.net
Automatic comment from SVN on behalf of degeberg
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=299367
Log: Fixed PHP bug #51814 (ArrayIterator::append arguments are listed incorrectly)
 [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
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 09:00:02 2026 UTC