|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67360 Missing element after ArrayObject::getIterator
Submitted: 2014-05-29 16:54 UTC Modified: 2014-05-30 10:38 UTC
From: im dot samuray at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: SPL related
PHP Version: 5.5.12 OS: debian 7
Private report: No CVE-ID: None
 [2014-05-29 16:54 UTC] im dot samuray at gmail dot com
Actually latest stable php i have is:
PHP 5.5.10-1~dotdeb.1 (cli) (built: Mar  6 2014 18:55:59) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans
    with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo

Error ilustrated in test script (BTW: checked in hhvm 3.1 - works as expected)

Test script:
$array = array('' => 1, 1 => 2, 3 => 4);
$ArrayObject = new ArrayObject($array);
$Iterator = $ArrayObject->getIterator();
var_dump(count($Iterator) === count($array));
//outputs false, but must be true
//element '' => 1 is missing

Expected result:
count($Iterator) === count($array) must be true

Actual result:
count($Iterator) === count($array) is false


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-29 17:58 UTC]
-Status: Open +Status: Closed -Package: Class/Object related +Package: SPL related -Assigned To: +Assigned To: aharvey
 [2014-05-29 17:58 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2014-05-30 10:38 UTC] im dot samuray at gmail dot com
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 03:01:28 2024 UTC