texthtml / object-reaper
Be notified of objects being destroyed
Package info
github.com/texthtml/php-object-reaper
Language:Shell
pkg:composer/texthtml/object-reaper
v1.1.0
2025-02-09 19:50 UTC
Requires (Dev)
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- slevomat/coding-standard: ^8.0
- squizlabs/php_codesniffer: ^3.6
- texthtml/doctest: ^0.2
This package is auto-updated.
Last update: 2026-02-14 12:39:05 UTC
README
Let you register callbacks that will be called when objects are destroyed.
Installation
composer req texthtml/object-reaper
Usage
$a = (object) []; // Attach a callback to any object // It will be called when the object is destroyed Reaper::watch($a, function () { echo "Good Bye"; }); // "Good bye" will be printed when $a is destroyed