Skip to content

Commit d353bd0

Browse files
committed
Add object_handle info in size_info to uniquely identify objects
1 parent 16e21d2 commit d353bd0

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2016-01-26 Benoit Jacquemont <[email protected]>
2+
* Added the object handle to uniquely identify objects
3+
14
2014-02-15 Benoit Jacquemont <[email protected]>
25
* Cleanup and release of v0.1.0
36

examples/size_info.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
$myObject->myDouble = $myDouble;
88
$myObject->myString = $myString;
99

10+
$myObject2 = new StdClass();
11+
12+
$myObjectRef = $myObject;
13+
1014
$myArray = [];
1115
$myArray[] = "TEST";
1216
$myArray[] = $myDouble;

meminfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ PHP_FUNCTION(meminfo_size_info)
265265
while (exec_frame) {
266266
frame_symbol_table = exec_frame->symbol_table;
267267

268-
269268
/* TODO Check why it is NULL sometimes
270269
* See some example where the symbol table
271270
* seems to be "regenerated"
@@ -450,6 +449,7 @@ void meminfo_browse_zval_with_size(php_stream * stream, zval * zv, HashTable *vi
450449

451450
php_stream_printf(stream TSRMLS_CC, ",\n");
452451
php_stream_printf(stream TSRMLS_CC, " \"class\" : \"%s\",\n", meminfo_escape_for_json(meminfo_get_classname(zv->value.obj.handle)));
452+
php_stream_printf(stream TSRMLS_CC, " \"object_handle\" : \"%d\",\n", zv->value.obj.handle);
453453

454454
properties = Z_OBJDEBUG_P(zv, is_temp);
455455

0 commit comments

Comments
 (0)