Skip to content

Commit a9e0eef

Browse files
committed
Merge pull request #16 from fitn/patch-2
Update README.md with meminfo_size_info function example
2 parents d353bd0 + 17f0860 commit a9e0eef

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,39 @@ The `examples/` directory at the root of the repository contains more detailed e
9999
```
100100

101101

102+
## List of items in memory
103+
Provides a list of items in memory (objects, arrays, string, etc.) with their sizes.
104+
105+
```php
106+
meminfo_size_info(fopen('php://stdout','w'));
107+
```
108+
109+
For example:
110+
```json
111+
// ...
112+
"0x7fe06ea50a40" : {
113+
"type" : "array",
114+
"size" : "96",
115+
"children" : {
116+
"0":"0x7fe06ea649b0"
117+
}
118+
119+
},
120+
"0x7fe06ea649b0" : {
121+
"type" : "string",
122+
"size" : "99"
123+
124+
},
125+
//...
126+
```
127+
128+
Note: The same remark about `gc_collect_cycles()` before `meminfo_objects_summary()` applies as well for this function.
129+
130+
### Examples
131+
The `examples/` directory at the root of the repository contains more detailed examples.
132+
133+
php examples/size_info.php
134+
102135
##List of currently active objects
103136
Provides a list of live objects with their class and their handle, as well as the total number of active objects and the total number of allocated object buckets.
104137

0 commit comments

Comments
 (0)