CVS update: php4/ext/standard
| From: | andrey | Date: | Wed, 09 Jun 1999 22:03:15 +0000 |
| Subject: | CVS update: php4/ext/standard | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1442@lists.php.net to get a copy of this message | ||
Date: Wednesday June 9, 1999 @ 18:03
Author: andrey
Update of /repository/php4/ext/standard
In directory php:/tmp/cvs-serv19874/ext/standard
Modified Files:
basic_functions.c
Log Message:
Make array_shift/array_pop work better.
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.30 php4/ext/standard/basic_functions.c:1.31
--- php4/ext/standard/basic_functions.c:1.30 Wed Jun 9 17:13:05 1999
+++ php4/ext/standard/basic_functions.c Wed Jun 9 18:03:15 1999
@@ -2571,6 +2571,7 @@
{
zval *stack, /* Input stack */
**val; /* Value to be popped */
+ HashTable *new_hash; /* New stack */
char *string_key;
ulong num_key;
@@ -2600,16 +2601,10 @@
return_value->is_ref=0;
/* Delete the first or last value */
- switch (zend_hash_get_current_key(stack->value.ht, &string_key, &num_key)) {
- case HASH_KEY_IS_STRING:
- zend_hash_del(stack->value.ht, string_key, strlen(string_key)+1);
- efree(string_key);
- break;
-
- case HASH_KEY_IS_LONG:
- zend_hash_index_del(stack->value.ht, num_key);
- break;
- }
+ new_hash = _phpi_splice(stack->value.ht, (off_the_end) ? -1 : 0, 1, NULL, 0, NULL);
+ zend_hash_destroy(stack->value.ht);
+ efree(stack->value.ht);
+ stack->value.ht = new_hash;
}
/* }}} */