]> granicus.if.org Git - php/commitdiff
add resource type to info
authorkrakjoe <joe.watkins@live.co.uk>
Mon, 18 Nov 2013 23:18:22 +0000 (23:18 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Mon, 18 Nov 2013 23:18:22 +0000 (23:18 +0000)
phpdbg_info.c
test.php

index f633038307770eb4ee58eba4e44be30b58eeaf35..246a3f5bec4844ddb9b22b26aec5cd5226ffbd1e 100644 (file)
@@ -106,8 +106,22 @@ PHPDBG_INFO(vars) /* {{{ */
                                        case IS_OBJECT:         phpdbg_write("(object)\t");     break;
                                        case IS_NULL:           phpdbg_write("(null)\t");               break;
                                }
-                       
-                               if (Z_TYPE_PP(data) == IS_OBJECT) {
+                               
+                               if (Z_TYPE_PP(data) == IS_RESOURCE) {
+                                       int type;
+                                       
+                                       phpdbg_writeln(
+                                               "%s$%s", Z_ISREF_PP(data) ? "&": "", var);
+                                       if (zend_list_find(Z_RESVAL_PP(data), &type)) {
+                                               phpdbg_write(
+                                                       "|-------(typeof)------> (%s)",
+                                                       zend_rsrc_list_get_rsrc_type(type TSRMLS_CC));
+                                       } else {
+                                               phpdbg_write(
+                                                       "|-------(typeof)------> (unknown)");
+                                       }
+                                       phpdbg_writeln(EMPTY);
+                               } else if (Z_TYPE_PP(data) == IS_OBJECT) {
                                        phpdbg_writeln(
                                                "%s$%s", Z_ISREF_PP(data) ? "&": "", var);
                                        phpdbg_write(
index 2266d157d5b8ffe66a875e003ad9643afa2bb701..4da4e08f97e244a6d2c9be90fbae36f5bf86ea20 100644 (file)
--- a/test.php
+++ b/test.php
@@ -2,6 +2,8 @@
 if (isset($include))
        include (sprintf("%s/web-bootstrap.php", dirname(__FILE__)));
 
+$stdout = fopen("php://stdout", "w+");
+
 class phpdbg {
     public function isGreat($greeting = null) {
         printf(