1
0
mirror of https://github.com/danog/process.git synced 2024-12-12 00:59:41 +01:00
process/examples/basic-command.php
2017-09-17 17:57:32 +02:00

16 lines
338 B
PHP

<?php
include dirname(__DIR__) . "/vendor/autoload.php";
use Amp\ByteStream\Message;
use Amp\Process\Process;
Amp\Loop::run(function () {
$process = yield Process::start("echo 'Hello, world!'");
echo yield new Message($process->getStdout());
$code = yield $process->join();
echo "Process exited with {$code}.\n";
});