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.
Problem
When running the
ab
command to test the performance of the http server oninnmind/vendor-graphs
. A bug appeared where some variables value was no longer available in memory.The problem is due to too many circular references being set filling PHP's memory root buffer. Most of the circular references are due to the
Fiber
s referencing the frameworkApplication
object (and all its versions, as each call of the middleware creates a new object). This is the case because the closure built to then be run to handle a request capture$this
.$this
is captured to simplify accessing previous properties but only the properties are needed and not the wholeApplication
object.Solution
$this
static
to make sure$this
is never captured