php.net |  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
Description:
------------
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
var_dump(iterator_to_array($Iterator));
//element '' => 1 is missing

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

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-29 17:58 UTC] aharvey@php.net
-Status: Open +Status: Closed -Package: Class/Object related +Package: SPL related -Assigned To: +Assigned To: aharvey
 [2014-05-29 17:58 UTC] aharvey@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
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
Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC