https://github.com/texthtml/php-object-reaper
Let you register callbacks that will be called when objects are destroyed.
https://github.com/texthtml/php-object-reaper
Last synced: 5 months ago
JSON representation
Let you register callbacks that will be called when objects are destroyed.
- Host: GitHub
- URL: https://github.com/texthtml/php-object-reaper
- Owner: texthtml
- License: mit
- Created: 2024-09-10T22:21:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-14T12:10:49.000Z (6 months ago)
- Last Synced: 2025-12-16T17:20:53.934Z (6 months ago)
- Language: Shell
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Object Reaper: here for your objects when they pass away
Let you register callbacks that will be called when objects are destroyed.
# Installation
```bash
composer req texthtml/object-reaper
```
# Usage
```php
$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
```