functions.php
Table of Contents
Constants
Functions
- pipe() : int
- buffer() : string
- getInputBufferStream() : ReadableResourceStream
- The php://input buffer stream for the process associated with the currently active event loop.
- getOutputBufferStream() : WritableResourceStream
- The php://output buffer stream for the process associated with the currently active event loop.
- getStdin() : ReadableResourceStream
- The STDIN stream for the process associated with the currently active event loop.
- getStdout() : WritableResourceStream
- The STDOUT stream for the process associated with the currently active event loop.
- getStderr() : WritableResourceStream
- The STDERR stream for the process associated with the currently active event loop.
- split() : Traversable<int, string>
- Splits the stream into chunks based on a delimiter.
- splitLines() : Traversable<int, string>
- Splits the stream into lines.
- parseLineDelimitedJson() : Traversable<int, mixed>
Constants
STDERR
public
mixed
STDERR
= \fopen('php://stderr', 'wb')
STDOUT
public
mixed
STDOUT
= \fopen('php://stdout', 'wb')
Functions
pipe()
pipe(ReadableStream $source, WritableStream $destination[, Cancellation|null $cancellation = null ]) : int
Parameters
- $source : ReadableStream
- $destination : WritableStream
- $cancellation : Cancellation|null = null
Return values
int —The number of bytes written to the destination.
buffer()
buffer(ReadableStream $source[, Cancellation|null $cancellation = null ][, int $limit = PHP_INT_MAX ]) : string
Parameters
- $source : ReadableStream
- $cancellation : Cancellation|null = null
- $limit : int = PHP_INT_MAX
-
Only buffer up to the given number of bytes, throwing BufferException if exceeded.
Tags
Return values
string —Entire contents of the InputStream.
getInputBufferStream()
The php://input buffer stream for the process associated with the currently active event loop.
getInputBufferStream() : ReadableResourceStream
Return values
ReadableResourceStreamgetOutputBufferStream()
The php://output buffer stream for the process associated with the currently active event loop.
getOutputBufferStream() : WritableResourceStream
Return values
WritableResourceStreamgetStdin()
The STDIN stream for the process associated with the currently active event loop.
getStdin() : ReadableResourceStream
Return values
ReadableResourceStreamgetStdout()
The STDOUT stream for the process associated with the currently active event loop.
getStdout() : WritableResourceStream
Return values
WritableResourceStreamgetStderr()
The STDERR stream for the process associated with the currently active event loop.
getStderr() : WritableResourceStream
Return values
WritableResourceStreamsplit()
Splits the stream into chunks based on a delimiter.
split(ReadableStream $source, non-empty-string $delimiter[, Cancellation|null $cancellation = null ]) : Traversable<int, string>
Parameters
- $source : ReadableStream
- $delimiter : non-empty-string
- $cancellation : Cancellation|null = null
Return values
Traversable<int, string>splitLines()
Splits the stream into lines.
splitLines(ReadableStream $source[, Cancellation|null $cancellation = null ]) : Traversable<int, string>
Parameters
- $source : ReadableStream
- $cancellation : Cancellation|null = null
Return values
Traversable<int, string>parseLineDelimitedJson()
parseLineDelimitedJson(ReadableStream $source[, bool $associative = false ][, int<1, 2147483647> $depth = 512 ][, int $flags = 0 ][, Cancellation|null $cancellation = null ]) : Traversable<int, mixed>
Parameters
- $source : ReadableStream
- $associative : bool = false
- $depth : int<1, 2147483647> = 512
- $flags : int = 0
- $cancellation : Cancellation|null = null
Tags
Return values
Traversable<int, mixed> —Traversable of decoded JSON values