ankane / php-memcheck
Check PHP FFI bindings for memory issues
v0.1.1
2026-11-07 22:29 UTC
Requires
- php: >= 8.2
Requires (Dev)
- ext-ffi: >= 8.2
- phpunit/phpunit: ^11
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-08 14:41:58 UTC
README
Check PHP FFI bindings for memory issues
Installation
First, install Valgrind. For Ubuntu, use:
sudo apt-get install valgrind
Then run:
composer require --dev ankane/php-memcheck
Getting Started
Add a script to composer.json with php-memcheck <test-command>:
"scripts": { "test": "phpunit tests", "memcheck": "php-memcheck phpunit tests" }
And run:
composer memcheck
Reference
See if Memcheck is running
function memcheckRunning() { return getenv('PHP_MEMCHECK_RUNNING') !== false; }
Thanks
Thanks to Valgrind, which does all of the work, and ruby_memcheck for the inspiration.
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/php-memcheck.git cd php-memcheck composer install composer test