[xdebug-dev] xdebug xdebug/xdebug_var.c - if we are an empty object or array, dont pretent to have children

From: Shane Caraveo <shane[@]caraveo.com>
Date: Sat, 17 Jul 2004 01:20:06 +0200

Date: Sat Jul 17 01:20:06 CEST 2004
User: Shane Caraveo
Directory: xdebug

Log Message:
[0.5]
- if we are an empty object or array, dont pretent to have children
- php documents the array data type, not a hash data type, give it the appropriate name so as to not confuse people.

Modified files:
           xdebug/xdebug_var.c (version: 1.47)

[FILE: /xdebug/xdebug_var.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- xdebug/xdebug_var.c:1.46 Thu Jul 15 00:15:49 2004 GMT
+++ xdebug/xdebug_var.c Fri Jul 16 21:20:06 2004 GMT
@@ -479,9 +479,9 @@
                         break;
 
                 case IS_ARRAY:
- xdebug_xml_add_attribute(node, "type", "hash");
- xdebug_xml_add_attribute(node, "children", "1");
                         myht = Z_ARRVAL_PP(struc);
+ xdebug_xml_add_attribute(node, "type", "array");
+ xdebug_xml_add_attribute(node, "children", myht->nNumOfElements > 0?"1":"0");
                         if (myht->nApplyCount < 1) {
                                 xdebug_xml_add_attribute_ex(node, "numchildren", xdebug_sprintf("%d", myht->nNumOfElements), 0, 1);
                                 zend_hash_apply_with_arguments(myht, (apply_func_args_t) xdebug_array_element_export_xml_node, 3, level, node, name);
@@ -491,10 +491,10 @@
                         break;
 
                 case IS_OBJECT:
+ myht = Z_OBJPROP_PP(struc);
                         xdebug_xml_add_attribute(node, "type", "object");
- xdebug_xml_add_attribute(node, "children", "1");
+ xdebug_xml_add_attribute(node, "children", myht->nNumOfElements > 0?"1":"0");
                         xdebug_xml_add_attribute_ex(node, "classname", xdstrdup(Z_OBJCE_PP(struc)->name), 0, 1);
- myht = Z_OBJPROP_PP(struc);
                         if (myht->nApplyCount < 1) {
                                 xdebug_xml_add_attribute_ex(node, "numchildren", xdebug_sprintf("%d", myht->nNumOfElements), 0, 1);
                                 zend_hash_apply_with_arguments(myht, (apply_func_args_t) xdebug_object_element_export_xml_node, 3, level, node, name);
Received on Sat Jul 17 2004 - 01:20:14 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:02 BST