1. Go to this page and download the library: Download expressif/stream 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/ */
expressif / stream example snippets
xpressif\Stream\EventEmitter;
class Foo extends EventEmitter {
public function bar() {
$this->emit('bar', ['baz']);
}
}
$foo = new Foo();
$foo->on('bar', function($what) {
echo "Foo $what !\n";
});
$foo->bar();