summaryrefslogtreecommitdiff
path: root/ext/spl/spl_fixedarray.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2011-06-02 00:40:27 +0000
committerFelipe Pena <felipe@php.net>2011-06-02 00:40:27 +0000
commitdf4c4a9e7f4e11fec8797d8c9c1141ccc6e8633e (patch)
treec4be5cf0b933e05881054dfd4b722d3db3eef495 /ext/spl/spl_fixedarray.c
parentbe20efc476683eb46b90c1ec4375acadb278d8db (diff)
downloadphp-git-df4c4a9e7f4e11fec8797d8c9c1141ccc6e8633e.tar.gz
- Fixed bug #54970 (SplFixedArray::setSize() isn't resizing)
Diffstat (limited to 'ext/spl/spl_fixedarray.c')
-rw-r--r--ext/spl/spl_fixedarray.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index fc282b4075..34cb69cccd 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -154,6 +154,8 @@ static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {
int i = 0;
if (intern->array) {
+ int j = zend_hash_num_elements(ht);
+
for (i = 0; i < intern->array->size; i++) {
if (intern->array->elements[i]) {
zend_hash_index_update(ht, i, (void *)&intern->array->elements[i], sizeof(zval *), NULL);
@@ -166,6 +168,11 @@ static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {
Z_ADDREF_P(EG(uninitialized_zval_ptr));
}
}
+ if (j > intern->array->size) {
+ for (i = intern->array->size; i < j; ++i) {
+ zend_hash_index_del(ht, i);
+ }
+ }
}
return ht;