STDOUT, STDERR not defined in CLI mode

php.internals

Alex Kiesel

23 years ago
Hi, sometimes STDIN, STDOUT and STDERR are not defined in cli mode: ~/cvs/php/php-src# ./sapi/cli/php -r 'var_dump (STDERR);' resource(3) of type (stream) ~/cvs/php/php-src# echo '<?php var_dump(STDERR); ?> ' | ./sapi/cli/php string(6) "STDERR" The attached patch removes the check for the scripts filename and always registeres the STD*-constants in PHP_MODE_STANDARD. Certainly it does not make sense to read from STDIN when called the second way, but it may be necessary to have STDOUT and STDERR defined. Also, accessing STDIN does not lead to segfaults or other oddities. - Alex