1. Go to this page and download the library: Download fast-forward/defer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fast-forward / defer example snippets
use FastForward\Defer\Defer;
function example(): void
{
$defer = new Defer();
$defer(function () {
echo "First defer\n";
});
$defer(function () {
echo "Second defer\n";
});
echo "Inside function\n";
}
example();
function example(): void
{
$defer = new Defer();
$defer(function ($file) {
echo "Deleting {$file}\n";
}, 'temp.txt');
echo "Working...\n";
}
example();