2019-07-15 16:16:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Amp\ByteStream\ResourceInputStream;
|
|
|
|
use Amp\ByteStream\ResourceOutputStream;
|
|
|
|
use Amp\ByteStream\ZlibOutputStream;
|
|
|
|
use Amp\Loop;
|
|
|
|
use function Amp\ByteStream\bufferEcho;
|
2019-08-22 22:42:20 +02:00
|
|
|
use function Amp\ByteStream\prompt;
|
2019-07-15 16:16:07 +02:00
|
|
|
|
|
|
|
require __DIR__ . "/../vendor/autoload.php";
|
|
|
|
|
|
|
|
Loop::run(function () {
|
|
|
|
yield bufferEcho("Hello from async PHP!\n");
|
2019-08-22 22:42:20 +02:00
|
|
|
$question = yield prompt("What is your question? ");
|
2019-07-15 16:16:07 +02:00
|
|
|
yield bufferEcho("I see your question is $question.\n");
|
|
|
|
yield bufferEcho("\nUnfortunately, I'm just a small script and I can't answer that, feel free to contact us at #amphp on freenode though!\n\n");
|
|
|
|
yield bufferEcho("Bye!\n\n");
|
|
|
|
});
|