diff options
author | Adam Harvey <aharvey@php.net> | 2014-05-29 17:49:32 +0000 |
---|---|---|
committer | Adam Harvey <aharvey@php.net> | 2014-05-29 17:49:32 +0000 |
commit | b5d9983ff4373793621ee4b21d4964b30c5d21c8 (patch) | |
tree | dd6e5b8c128540857b4caca180bfc3eba96bbb9e /ext/spl/tests/bug67360.phpt | |
parent | d2765e4b8ca83ca0fbac6a8d1c3b8e52209010a1 (diff) | |
download | php-git-b5d9983ff4373793621ee4b21d4964b30c5d21c8.tar.gz |
Check for zero-length keys in spl_array_skip_protected and don't skip them.
Fixes bug #67360 (Missing element after ArrayObject::getIterator).
Diffstat (limited to 'ext/spl/tests/bug67360.phpt')
-rw-r--r-- | ext/spl/tests/bug67360.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/spl/tests/bug67360.phpt b/ext/spl/tests/bug67360.phpt new file mode 100644 index 0000000000..552c02ad74 --- /dev/null +++ b/ext/spl/tests/bug67360.phpt @@ -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) +} |