Search by

ankane / php-memcheck

ankane

Check PHP FFI bindings for memory issues

Package info

github.com/ankane/php-memcheck

pkg:composer/ankane/php-memcheck

Statistics

Installs: 33

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-11-07 22:29 UTC

This package is not auto-updated.

Last update: 2026-11-08 14:41:58 UTC


README

Check PHP FFI bindings for memory issues

Build Status

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:

To get started with development:

git clone https://github.com/ankane/php-memcheck.git
cd php-memcheck
composer install
composer test