cvs: php4 /ext/standard array.c

From: Date: Thu, 01 Aug 2002 16:39:52 +0000
Subject: cvs: php4 /ext/standard array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13084@lists.php.net to get a copy of this message
sniper Thu Aug 1 12:39:52 2002 EDT Modified files: /php4/ext/standard array.c Log: Reset index when doing array_pop() Index: php4/ext/standard/array.c diff -u php4/ext/standard/array.c:1.177 php4/ext/standard/array.c:1.178 --- php4/ext/standard/array.c:1.177 Thu Aug 1 08:07:15 2002 +++ php4/ext/standard/array.c Thu Aug 1 12:39:52 2002 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.177 2002/08/01 12:07:15 sniper Exp $ */ +/* $Id: array.c,v 1.178 2002/08/01 16:39:52 sniper Exp $ */ #include "php.h" #include "php_ini.h" @@ -1695,7 +1695,7 @@ zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, index, (key) ? HASH_DEL_KEY : HASH_DEL_INDEX); /* If we did a shift... re-index like it did before */ - if(!off_the_end) { + if (!off_the_end) { HANDLE_BLOCK_INTERRUPTIONS(); { int k = 0; @@ -1709,6 +1709,9 @@ zend_hash_rehash(Z_ARRVAL_PP(stack)); } HANDLE_UNBLOCK_INTERRUPTIONS(); + } else { + Z_ARRVAL_PP(stack)->nNextFreeElement--; + zend_hash_rehash(Z_ARRVAL_PP(stack)); } } /* }}} */

« previous php.cvs (#13084) next »