@@ -526,7 +526,7 @@ static void php_cli_usage(char *argv0)
526
526
527
527
static php_stream * s_in_process = NULL ;
528
528
529
- static void cli_register_file_handles (void ) /* {{{ */
529
+ static void cli_register_file_handles (bool no_close ) /* {{{ */
530
530
{
531
531
php_stream * s_in , * s_out , * s_err ;
532
532
php_stream_context * sc_in = NULL , * sc_out = NULL , * sc_err = NULL ;
@@ -954,7 +954,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
954
954
switch (behavior ) {
955
955
case PHP_MODE_STANDARD :
956
956
if (script_file ) {
957
- cli_register_file_handles ();
957
+ cli_register_file_handles (/* no_close */ PHP_DEBUG || num_repeats > 1 );
958
958
}
959
959
960
960
if (interactive ) {
@@ -990,7 +990,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
990
990
}
991
991
break ;
992
992
case PHP_MODE_CLI_DIRECT :
993
- cli_register_file_handles ();
993
+ cli_register_file_handles (/* no_close */ PHP_DEBUG || num_repeats > 1 );
994
994
zend_eval_string_ex (exec_direct , NULL , "Command line code" , 1 );
995
995
break ;
996
996
@@ -1005,7 +1005,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
1005
1005
file_handle .filename = NULL ;
1006
1006
}
1007
1007
1008
- cli_register_file_handles ();
1008
+ cli_register_file_handles (/* no_close */ PHP_DEBUG || num_repeats > 1 );
1009
1009
1010
1010
if (exec_begin ) {
1011
1011
zend_eval_string_ex (exec_begin , NULL , "Command line begin code" , 1 );
0 commit comments