exec(Process::BUFFER_ALL); /* send to stdin */ $proc->write("abc\n"); /* wait for process end */ $result = (yield $promise); var_dump($result->stdout); // "abc" });