Index: ext/spl/spl_fastarray.c =================================================================== RCS file: /repository/php-src/ext/spl/spl_fastarray.c,v retrieving revision 1.1.2.7 diff -u -p -d -r1.1.2.7 spl_fastarray.c --- ext/spl/spl_fastarray.c 9 Jun 2008 17:29:23 -0000 1.1.2.7 +++ ext/spl/spl_fastarray.c 11 Jun 2008 11:11:33 -0000 @@ -143,46 +143,24 @@ static void spl_fastarray_copy(spl_fasta } /* }}} */ -static HashTable* spl_fastarray_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{{ */ +static HashTable* spl_fastarray_object_get_properties(zval *obj TSRMLS_DC) /* {{{{ */ { spl_fastarray_object *intern = (spl_fastarray_object*)zend_object_store_get_object(obj TSRMLS_CC); - HashTable *rv; - zval *tmp, zrv, *fastarray_array; - char *pnstr; - int pnlen; int i = 0;; - *is_temp = 1; - - ALLOC_HASHTABLE(rv); - ZEND_INIT_SYMTABLE_EX(rv, zend_hash_num_elements(intern->std.properties) + 1, 0); - - INIT_PZVAL(&zrv); - Z_ARRVAL(zrv) = rv; - - zend_hash_copy(rv, intern->std.properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - ALLOC_INIT_ZVAL(fastarray_array); - array_init(fastarray_array); - - if (intern->array) { for (i = 0; i < intern->array->size; i++) { if (intern->array->elements[i]) { - add_index_zval(fastarray_array, i, (zval *)intern->array->elements[i]); + zend_hash_index_update(intern->std.properties, i, (void *)&intern->array->elements[i], sizeof(zval *), NULL); Z_ADDREF_P(intern->array->elements[i]); } else { - add_index_zval(fastarray_array, i, (zval *)EG(uninitialized_zval_ptr)); + zend_hash_index_update(intern->std.properties, i, (void *)&EG(uninitialized_zval_ptr), sizeof(zval *), NULL); Z_ADDREF_P(EG(uninitialized_zval_ptr)); } } } - pnstr = spl_gen_private_prop_name(spl_ce_SplFastArray, "array", sizeof("array")-1, &pnlen TSRMLS_CC); - add_assoc_zval_ex(&zrv, pnstr, pnlen+1, fastarray_array); - efree(pnstr); - - return rv; + return intern->std.properties; } /* }}}} */ @@ -950,7 +928,7 @@ PHP_MINIT_FUNCTION(spl_fastarray) spl_handler_SplFastArray.unset_dimension = spl_fastarray_object_unset_dimension; spl_handler_SplFastArray.has_dimension = spl_fastarray_object_has_dimension; spl_handler_SplFastArray.count_elements = spl_fastarray_object_count_elements; - spl_handler_SplFastArray.get_debug_info = spl_fastarray_object_get_debug_info; + spl_handler_SplFastArray.get_properties = spl_fastarray_object_get_properties; REGISTER_SPL_IMPLEMENTS(SplFastArray, Iterator); REGISTER_SPL_IMPLEMENTS(SplFastArray, ArrayAccess);