Closed matt-allan closed 7 years ago
Re: @bwoebi https://github.com/sebastianbergmann/php-code-coverage/issues/474#issuecomment-255116142 A pull request that improves this would be much appreciated ;-)
@sebastianbergmann I'm not certain what you are trying to do there. It looks a bit like you're trying to detect recursive arrays?
If that's the case, you could just add an element to the array (e.g. an object), check if it exists (if (end($array) === $myObject)
) and remove it again later on. Or were there issues with that approach?
@sebastianbergmann Can you please check #4 ?
Thanks @bwoebi and @sebastianbergmann, I really appreciate it 😄
Hello,
While generating coverage data with phpdbg, I am experiencing an issue where php's memory usage climbs exponentially until exhaustion. This only happens in some cases and depends on the code being tested or executed in the test.
Reproduction steps:
Expected results:
The tests should run and generate coverage.
Actual results:
If the
memory_limit
is set, the tests will quickly reach the memory limit and the process is killed. If thememory_limit
is set to-1
, the tests will slowly consume more memory while using > 90% CPU.I raised the issue with phpdbg here:
https://github.com/krakjoe/phpdbg/issues/159
if I'm understanding correctly, phpdbg's oplog is being passed to
SebastianBergmann\RecursionContext\Context::containsArray
. The search is O(n^2) and the search space is really huge. It's impossible to keep up with the oplog, so the test runs incredibly slow and runs out of memory before it finishes.