An open API service indexing awesome lists of open source software.

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.

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
```