Add static local variables to the dump #118
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I have been using php-meminfo to find how my projects tests exhausting memory, and it's been great. Thank you!
However, I found that meminfo misses something: static local variables. Using https://github.com/johannes/php-staticvardumper as a resource (but is 8 years old and worked only on php 5, so I had to do some updates), I augmented php-meminfo to find and add static local variables to the dump. Please see the two test for examples.
I had to make a choice for the frame_label. I chose
<STATIC_VARIABLE(ClassName::MethodName)>
, and in the case that the function wasn't a method, but global, I chose<GLOBAL_FUNCTION>
for the classname (resulting in<STATIC_VARIABLE(<GLOBAL_FUNCTION>::MethodName)>
). A little wordy, but I think it conveys the meaning pretty well. These are easily changeable though if you prefer something else :)Thanks again for the tool and let me know if you'd like anything changed.