com php-src: add resource type to info: phpdbg_info.c tes t.php
| From: | Bob Weinand | Date: | Mon, 18 Nov 2013 23:18:22 +0000 |
| Subject: | com php-src: add resource type to info: phpdbg_info.c tes t.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74822@lists.php.net to get a copy of this message | ||
Commit: d82eca8c861092816d51d0b3b7b000a717641915
Author: krakjoe <joe.watkins@live.co.uk> Mon, 18 Nov 2013 23:18:22 +0000
Parents: 1051564059d6e8a1a8e802c78a9eb9348327ed3c
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d82eca8c861092816d51d0b3b7b000a717641915
Log:
add resource type to info
Changed paths:
M phpdbg_info.c
M test.php
Diff:
diff --git a/phpdbg_info.c b/phpdbg_info.c
index f633038..246a3f5 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 2266d15..4da4e08 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(