1. Go to this page and download the library: Download gandung/promise 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/ */
use Gandung\Promise\Promise;
$promise = new Promise();
$promise->then(
function($d) {
echo sprintf("%s" . PHP_EOL, $d);
},
function($e) {
throw new \Exception($e);
}
);
use Gandung\Promise\FulfilledPromise;
$promise = new FulfilledPromise('the quick dirty brown fox.');
$promise->then(function($d) {
echo sprintf("%s" . PHP_EOL, $d);
});
use Gandung\Promise\RejectedPromise;
$promise = new RejectedPromise('the quick dirty brown fox.');
$promise->then(null, function($e) {
throw new \Exception($e);
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.