diff options
author | foobar <sniper@php.net> | 2003-02-06 15:27:53 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2003-02-06 15:27:53 +0000 |
commit | 20f9b6d02c5799ee5185b8673b57ef07be3bb345 (patch) | |
tree | 9838f0b049583c501ec219b06c222dac886d0a88 | |
parent | 073a80fbcc0ad009a6e15e72c92ee89a06366158 (diff) | |
download | php-git-20f9b6d02c5799ee5185b8673b57ef07be3bb345.tar.gz |
- Fixed bug #22088 (array_shift() leaves next index to be +1 too much)
-rw-r--r-- | ext/standard/array.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index b97adfab5b..32edd74c1f 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1860,11 +1860,12 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) int k = 0; Bucket *p = Z_ARRVAL_PP(stack)->pListHead; while (p != NULL) { - if (p->nKeyLength == 0) + if (p->nKeyLength == 0) { p->h = k++; + } p = p->pListNext; } - Z_ARRVAL_PP(stack)->nNextFreeElement = k+1; + Z_ARRVAL_PP(stack)->nNextFreeElement = k; zend_hash_rehash(Z_ARRVAL_PP(stack)); } else if (!key_len) { Z_ARRVAL_PP(stack)->nNextFreeElement = Z_ARRVAL_PP(stack)->nNextFreeElement - 1; |