|
Posted by ljb on 11/13/07 00:46
Using the PHP CLI executable, if the script to run is fed to PHP via
standard input, then it seems PHP does not define any of the standard
stream constants STDIN, STDOUT, and STDERR. While I can understand not
defining STDIN, since that's where the script is, I think not defining
STDOUT and STDERR is a bug. Any comments before I open a bug report?
Confirmation?
--- Test script 'nostd.php' ---
<?php
fwrite(STDOUT, "Hello, standard output\n");
fwrite(STDERR, "Hello, standard error\n");
-------------------------------
Run: $ php nostd.php
Works as expected.
Run: $ php < nostd.php
Produces NOTICE and Warning messages about STDOUT and STDERR not defined.
[Back to original message]
|