helly Thu Jul 24 16:28:16 2003 EDT Modified files: /spl spl_array.c Log: Update due to Zeev's latest engine changes Index: spl/spl_array.c diff -u spl/spl_array.c:1.10 spl/spl_array.c:1.11 --- spl/spl_array.c:1.10 Sat Jul 19 21:22:03 2003 +++ spl/spl_array.c Thu Jul 24 16:28:15 2003 @@ -378,23 +378,19 @@ 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 @@ 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);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php