PHP code example of digphp / psr14
1. Go to this page and download the library: Download digphp/psr14 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/ */
digphp / psr14 example snippets
php
$event = new Event;
$event->listen(function (stdClass $obj) {
echo 'foo';
}, 2);
$event->listen(function (stdClass $obj) {
echo 'bar';
}, 1);
$event->listen(function (stdClass $obj) {
echo 'baz';
}, 3);
$obj = new stdClass;
$event->dispatch($obj);
// baz foo bar