start(); $stream = $process->getStdout(); while ($chunk = yield $stream->read()) { echo $chunk; } $code = yield $process->join(); echo "Process exited with {$code}.\n"; });