1. Go to this page and download the library: Download m6w6/hikke 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/ */
m6w6 / hikke example snippets
use hikke\Event;
class Observer implements \SplObserver {
private $name;
function __construct($name) {
$this->name = $name;
}
function update(\SplSubject $e) {
echo "Observer '{$this->name}' notified by '$e' ({$e->getPriority()})\n";
}
function proxiedMethodCall($arg) {
$this->name .= $arg;
}
}
$event = new Event("my_event");
$event->attach(new Observer("o1"), 1);
$event->attach(new Observer("o2"), 2);
$event->notify();