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