phasync
ProcessRunner / write

Method

ProcessRunner::write

Waits until the stream can take data, and writes as much as it takes; false if the process is not running.

Description#

public ProcessRunner::write(
    string $data,
    int $fd = phasync\Util\ProcessInterface::STDIN
): int|false

Parameters#

$data string
What to write
$fd int = phasync\Util\ProcessInterface::STDIN
ProcessInterface::STDIN

Return values#

The number of bytes written, which may be less than all of $data int|false

Errors / Exceptions#

ExceptionWhen
phasync\IOExceptionIf the stream is closed