summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-07-24 20:28:15 +0000
committerMarcus Boerger <helly@php.net>2003-07-24 20:28:15 +0000
commitd7b37fa96bf63eb3b8cfaca7e49259dab340be86 (patch)
treedf6f4a33b67e4c7666bbe0a80aea1163a8ab85ff
parent870610d679e3186e2886e1c4e931bf38f0993856 (diff)
downloadphp-git-d7b37fa96bf63eb3b8cfaca7e49259dab340be86.tar.gz
Update due to Zeev's latest engine changes
-rwxr-xr-xext/spl/spl_array.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index f4cdf2d156..f7413f5b89 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -378,23 +378,19 @@ zval *spl_array_read_dimension(zval *object, zval *offset TSRMLS_DC)
switch(Z_TYPE_P(offset)) {
case IS_STRING:
- if (!zend_is_numeric_key(offset, &index)) {
- if (zend_hash_find(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) {
- zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
- return EG(uninitialized_zval_ptr);
- } else {
- return *retval;
- }
- break;
+ if (zend_symtable_find(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) {
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ return EG(uninitialized_zval_ptr);
+ } else {
+ return *retval;
}
- /* NO break */
case IS_DOUBLE:
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
index = (long)Z_DVAL_P(offset);
- } else if (offset->type != IS_STRING) {
+ } else {
index = Z_LVAL_P(offset);
}
if (zend_hash_index_find(HASH_OF(intern->array), index, (void **) &retval) == FAILURE) {
@@ -419,18 +415,15 @@ void spl_array_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC
switch(Z_TYPE_P(offset)) {
case IS_STRING:
- if (!zend_is_numeric_key(offset, &index)) {
- add_assoc_zval(intern->array, Z_STRVAL_P(offset), value);
- return;
- }
- /* NO break */
+ zend_symtable_update(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
+ return;
case IS_DOUBLE:
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
index = (long)Z_DVAL_P(offset);
- } else if (offset->type != IS_STRING) {
+ } else {
index = Z_LVAL_P(offset);
}
add_index_zval(intern->array, index, value);