1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix GH-11104: STDIN/STDOUT/STDERR is not available for CLI without a script

I found no reason why this is done this way.
Of course this will allow users to do stupid stuff like
`fclose(STDOUT);` etc. but if they type in that code they clearly know
what they're doing...

Close GH-11169.
This commit is contained in:
nielsdos
2023-04-30 23:33:41 +02:00
parent 001e278549
commit f6c0c60ef6
2 changed files with 3 additions and 3 deletions

2
NEWS
View File

@@ -5,6 +5,8 @@ PHP NEWS
- CLI:
. Added pdeathsig to builtin server to terminate workers when the master
process is killed. (ilutov)
. Fixed bug GH-11104 (STDIN/STDOUT/STDERR is not available for CLI without
a script). (nielsdos)
- Core:
. Fixed bug GH-9388 (Improve unset property and __get type incompatibility

View File

@@ -951,9 +951,7 @@ do_repeat:
PG(during_request_startup) = 0;
switch (behavior) {
case PHP_MODE_STANDARD:
if (script_file) {
cli_register_file_handles();
}
cli_register_file_handles();
if (interactive) {
EG(exit_status) = cli_shell_callbacks.cli_shell_run();