StandardStream
in package
implements
StreamInterface
Standard stream implementation using real STDIN/STDOUT.
This is the production implementation that wraps PHP's standard input/output streams. Uses STDIN for reading and STDOUT for writing, providing real terminal interaction.
Table of Contents
Interfaces
- StreamInterface
- Interface for input/output stream abstraction.
Properties
- $inputStream : mixed
- $outputStream : mixed
Methods
- __construct() : mixed
- isInteractive() : bool
- Check if the stream is connected to an interactive terminal
- read() : string|false
- Read a line from the input stream
- write() : void
- Write data to the output stream
Properties
$inputStream
private
mixed
$inputStream
= STDIN
$outputStream
private
mixed
$outputStream
= STDOUT
Methods
__construct()
public
__construct([resource $inputStream = STDIN ][, resource $outputStream = STDOUT ]) : mixed
Parameters
- $inputStream : resource = STDIN
-
Input stream resource (default: STDIN)
- $outputStream : resource = STDOUT
-
Output stream resource (default: STDOUT)
isInteractive()
Check if the stream is connected to an interactive terminal
public
isInteractive() : bool
Tags
Return values
bool —True if interactive (TTY), false otherwise
read()
Read a line from the input stream
public
read() : string|false
Tags
Return values
string|false —Returns the read line or false on EOF
write()
Write data to the output stream
public
write(string $data) : void
Parameters
- $data : string
-
Data to write