Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 774a0a06f5
Fetching contributors…

Cannot retrieve contributors at this time

43 lines (28 sloc) 0.584 kB

Guard

Simplly cleaning up resources with RAII pattern.

Synopsis

unset()

$guard = new Guard(function () { echo "unset!\n"; });
unset($guard); //=> unset!

Function Scope

function foo()
{
    $guard = new Guard(function () { echo "destructed!\n"; });
    // ... do something ...
}

foo(); //=> echoed "destructed!" after function called

Run Tests Using Composer

$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install
$ bin/phpunit

LICENSE

Copyright

Copyright Kentaro Kuribayashi

LICENSE

MIT LICENSE

Jump to Line
Something went wrong with that request. Please try again.