From: krakjoe Date: Mon, 18 Nov 2013 23:18:22 +0000 (+0000) Subject: add resource type to info X-Git-Tag: php-5.6.0alpha1~110^2~218 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d82eca8c861092816d51d0b3b7b000a717641915;p=php add resource type to info --- diff --git a/phpdbg_info.c b/phpdbg_info.c index f633038307..246a3f5bec 100644 --- a/phpdbg_info.c +++ b/phpdbg_info.c @@ -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( diff --git a/test.php b/test.php index 2266d157d5..4da4e08f97 100644 --- 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(