texthtml / object-reaper
Be notified of objects being destroyed
Installs: 7
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Language:Shell
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: 2024-12-12 21:39:27 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