Skip to content

Commit

Permalink
Merge pull request #173 from sad270/refactor/remove-code-for-php-8.0
Browse files Browse the repository at this point in the history
refactor: remove gc_collect_cycles() called twice for PHP < 8.1
  • Loading branch information
Ocramius authored Aug 2, 2023
2 parents cfaf91a + 3ceeced commit ede929f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/CollectTestExecutionMemoryFootprints.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
use function memory_get_usage;
use function sprintf;

use const PHP_VERSION_ID;

/**
* Note: we need to implement TestListener, because the hook API is not allowing
* us to interact with test suite instances. This means that the entire package
Expand Down Expand Up @@ -52,19 +50,13 @@ public function startTestSuite(TestSuite $suite): void
public function executeBeforeTest(string $test): void
{
gc_collect_cycles();
if (PHP_VERSION_ID < 80100) {
gc_collect_cycles();
}

$this->preTestMemoryUsages[$test][] = memory_get_usage();
}

public function executeAfterSuccessfulTest(string $test, float $time): void
{
gc_collect_cycles();
if (PHP_VERSION_ID < 80100) {
gc_collect_cycles();
}

$this->postTestMemoryUsages[$test][] = memory_get_usage();
}
Expand Down

0 comments on commit ede929f

Please sign in to comment.