roave / no-leaks
Installs: 243 201
Dependents: 9
Suggesters: 0
Security: 0
Stars: 499
Watchers: 15
Forks: 20
Open Issues: 12
Requires
- php: ~8.1.0 || ~8.2.0
- ext-json: *
- phpunit/phpunit: ^9.6.10
Requires (Dev)
- doctrine/coding-standard: ^12.0.0
- psalm/plugin-phpunit: ^0.18.4
- roave/infection-static-analysis-plugin: ^1.32.0
- squizlabs/php_codesniffer: ^3.7.2
- vimeo/psalm: ^5.14.1
- 1.6.x-dev
- 1.5.x-dev
- 1.5.0
- 1.4.x-dev
- 1.4.0
- 1.3.x-dev
- 1.3.0
- 1.2.x-dev
- 1.2.0
- 1.1.x-dev
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-renovate/all-minor-patch
- dev-renovate/vimeo-psalm-6.x
- dev-renovate/phpunit-phpunit-12.x
- dev-renovate/doctrine-coding-standard-13.x
- dev-renovate/lock-file-maintenance
- dev-dependabot/composer/symfony/process-6.4.14
This package is auto-updated.
Last update: 2025-03-31 19:55:26 UTC
README
This library is a PHPUnit plugin
that detects memory leaks in tested code or tests.
It utilizes memory_get_usage()
to make sure the code being executed properly cleans up after itself.
Installation
composer require --dev roave/no-leaks
Usage
vendor/bin/roave-no-leaks
If any memory leaks are detected, you should see an output like following:
Exception: The following test produced memory leaks:
* My\Leaky\Test::testSomething
* My\Leaky\Test::testSomethingElse
Configuration and Parameters
vendor/bin/roave-no-leaks
supports all
configuration parameters and console parameters of PHPUnit.
Known Issues
Please be aware that this is not a full substitute for PHPUnit:
- the output format is to be improved
- memory leak detection for scalar types and arrays is not reliable
- can fail depending on xdebug/phpdbg/php-sapi changes
Professional Support
If you need help with setting up this library in your project, you can contact us at team@roave.com for consulting/support.