The "Resource and Persistent Handle Factory" extension provides facilities to manage those in a convenient manner.
This extension is hosted at PECL and can be installed with PEAR's pecl command:
# pecl install raphf
NOTE:
Please note, that v1.x of ext-raphf works for PHP-5 and v2.x/master works for PHP-7 and greater only.
Watch out for PECL replicates and pharext packages attached to releases.
git clone github.com:m6w6/ext-raphf
cd ext-raphf
/path/to/phpize
./configure --with-php-config=/path/to/php-config
make
sudo make install
NOTE:
This extension mostly only provides infrastructure for other extensions. See the API docs here: v1.1.x, master.
Clean persistent handles whith id $name->$ident.
void
raphf\clean_persistent_handles([string
name = NULL
[, string
$ident]])
Retrieve statistics about current process'/thread's persistent handles.
object raphf\stat_persistent_handles()