STDIN |
An already opened stream to stdin. This saves
opening it with
<?php
$stdin = fopen('php://stdin', 'r');
?>
If you want to read single line from stdin, you can
use
<?php
$line = trim(fgets(STDIN)); // reads one line from STDIN
fscanf(STDIN, "%d\n", $number); // reads number from STDIN
?>
|
STDOUT |
An already opened stream to stdout. This saves
opening it with
<?php
$stdout = fopen('php://stdout', 'w');
?>
|
STDERR |
An already opened stream to stderr.
This saves opening it with
<?php
$stderr = fopen('php://stderr', 'w');
?>
|