diff --git a/src/Symfony/Component/Debug/Resources/ext/README.rst b/src/Symfony/Component/Debug/Resources/ext/README.rst index 77be5648aaa2b..b0d1c58959fc9 100644 --- a/src/Symfony/Component/Debug/Resources/ext/README.rst +++ b/src/Symfony/Component/Debug/Resources/ext/README.rst @@ -33,12 +33,13 @@ Its behavior is about the same as: 'object_class' => get_class($array[$key]), 'object_refcount' => /* internal object refcount of $array[$key] */, 'object_hash' => spl_object_hash($array[$key]), + 'object_handle' => /* internal object handle $array[$key] */, ); break; case 'resource': $info += array( - 'resource_id' => (int) substr((string) $array[$key], 13), + 'resource_handle' => (int) $array[$key], 'resource_type' => get_resource_type($array[$key]), 'resource_refcount' => /* internal resource refcount of $array[$key] */, ); diff --git a/src/Symfony/Component/Debug/Resources/ext/symfony_debug.c b/src/Symfony/Component/Debug/Resources/ext/symfony_debug.c index 2bcb922d5c98b..8dc5d4356a819 100644 --- a/src/Symfony/Component/Debug/Resources/ext/symfony_debug.c +++ b/src/Symfony/Component/Debug/Resources/ext/symfony_debug.c @@ -72,10 +72,11 @@ PHP_FUNCTION(symfony_zval_info) add_assoc_stringl(return_value, "object_class", (char *)Z_OBJCE_P(arg)->name, Z_OBJCE_P(arg)->name_length, 1); add_assoc_long(return_value, "object_refcount", EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(arg)].bucket.obj.refcount); add_assoc_string(return_value, "object_hash", hash, 1); + add_assoc_long(return_value, "object_handle", Z_OBJ_HANDLE_P(arg)); } else if (Z_TYPE_P(arg) == IS_ARRAY) { add_assoc_long(return_value, "array_count", zend_hash_num_elements(Z_ARRVAL_P(arg))); } else if(Z_TYPE_P(arg) == IS_RESOURCE) { - add_assoc_long(return_value, "resource_id", Z_LVAL_P(arg)); + add_assoc_long(return_value, "resource_handle", Z_LVAL_P(arg)); add_assoc_string(return_value, "resource_type", (char *)_symfony_debug_get_resource_type(Z_LVAL_P(arg)), 1); add_assoc_long(return_value, "resource_refcount", _symfony_debug_get_resource_refcount(Z_LVAL_P(arg))); } else if (Z_TYPE_P(arg) == IS_STRING) { diff --git a/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt b/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt index a0015a939445c..30b25a25e2238 100644 --- a/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt +++ b/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt @@ -72,7 +72,7 @@ array(5) { ["strlen"]=> int(6) } -array(7) { +array(8) { ["type"]=> string(6) "object" ["zval_hash"]=> @@ -87,6 +87,8 @@ array(7) { int(1) ["object_hash"]=> string(32) "%s" + ["object_handle"]=> + int(1) } array(5) { ["type"]=> @@ -109,7 +111,7 @@ array(7) { int(2) ["zval_isref"]=> bool(false) - ["resource_id"]=> + ["resource_handle"]=> int(4) ["resource_type"]=> string(6) "stream" @@ -146,4 +148,4 @@ array(4) { ["zval_isref"]=> bool(true) } -NULL \ No newline at end of file +NULL