Method
ProcessInterface::read
Waits until the stream has something to read, and returns what is there.
Description#
public ProcessInterface::read(
int $fd = self::STDOUT
): string|falseReturns an empty string at the end of the stream. The stream is closed once the process has ended and was noticed to have: a read then throws an IOException.
Parameters#
- $fd int = self::STDOUT
ProcessInterface::STDOUTorSTDERR
Return values#
What was read string|false
Errors / Exceptions#
| Exception | When |
|---|---|
phasync\IOException | If the stream is closed |
See also#
ProcessInterface::writeWaits until the stream can take data, and writes as much as it takes.