forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for zero-length keys in spl_array_skip_protected and don't skip…
… them. Fixes bug #67360 (Missing element after ArrayObject::getIterator).
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--TEST-- | ||
Bug #67360 (Missing element after ArrayObject::getIterator) | ||
--FILE-- | ||
<?php | ||
|
||
$array = array('' => 1, 1 => 2, 3 => 4); | ||
$ArrayObject = new ArrayObject($array); | ||
var_dump($ArrayObject); | ||
$Iterator = $ArrayObject->getIterator(); | ||
var_dump(count($Iterator) === count($array)); | ||
var_dump(iterator_to_array($Iterator)); | ||
|
||
?> | ||
--EXPECTF-- | ||
object(ArrayObject)#%d (1) { | ||
["storage":"ArrayObject":private]=> | ||
array(3) { | ||
[""]=> | ||
int(1) | ||
[1]=> | ||
int(2) | ||
[3]=> | ||
int(4) | ||
} | ||
} | ||
bool(true) | ||
array(3) { | ||
[""]=> | ||
int(1) | ||
[1]=> | ||
int(2) | ||
[3]=> | ||
int(4) | ||
} |