helly Thu Oct 11 01:03:03 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard var.c Log: - MFH debug object helper http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.203.2.7.2.18.2.1&r2=1.203.2.7.2.18.2.2&diff_format=u Index: php-src/ext/standard/var.c diff -u php-src/ext/standard/var.c:1.203.2.7.2.18.2.1 php-src/ext/standard/var.c:1.203.2.7.2.18.2.2 --- php-src/ext/standard/var.c:1.203.2.7.2.18.2.1 Sun Oct 7 05:22:07 2007 +++ php-src/ext/standard/var.c Thu Oct 11 01:03:03 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c,v 1.203.2.7.2.18.2.1 2007/10/07 05:22:07 davidw Exp $ */ +/* $Id: var.c,v 1.203.2.7.2.18.2.2 2007/10/11 01:03:03 helly Exp $ */ @@ -98,6 +98,7 @@ char *class_name; zend_uint class_name_len; int (*php_element_dump_func)(zval**, int, va_list, zend_hash_key*); + int is_temp; if (level > 1) { php_printf("%*c", level - 1, ' '); @@ -129,9 +130,10 @@ } php_printf("%sarray(%d) {\n", COMMON, zend_hash_num_elements(myht)); php_element_dump_func = php_array_element_dump; + is_temp = 0; goto head_done; case IS_OBJECT: - myht = Z_OBJPROP_PP(struc); + myht = Z_OBJDEBUG_PP(struc, is_temp); if (myht && myht->nApplyCount > 1) { PUTS("*RECURSION*\n"); return; @@ -144,6 +146,10 @@ head_done: if (myht) { zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_element_dump_func, 1, level); + if (is_temp) { + zend_hash_destroy(myht); + efree(myht); + } } if (level > 1) { php_printf("%*c", level-1, ' ');
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php