@@ -1934,7 +1934,6 @@ function run_test(string $php, $file, array $env): string
1934
1934
$ diff_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'diff ' ;
1935
1935
$ log_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'log ' ;
1936
1936
$ exp_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'exp ' ;
1937
- $ stdin_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'stdin ' ;
1938
1937
$ output_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'out ' ;
1939
1938
$ memcheck_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'mem ' ;
1940
1939
$ sh_filename = $ temp_dir . DIRECTORY_SEPARATOR . $ main_file_name . 'sh ' ;
@@ -1973,7 +1972,6 @@ function run_test(string $php, $file, array $env): string
1973
1972
@unlink ($ diff_filename );
1974
1973
@unlink ($ log_filename );
1975
1974
@unlink ($ exp_filename );
1976
- @unlink ($ stdin_filename );
1977
1975
@unlink ($ output_filename );
1978
1976
@unlink ($ memcheck_filename );
1979
1977
@unlink ($ sh_filename );
@@ -2698,16 +2696,6 @@ function run_test(string $php, $file, array $env): string
2698
2696
$ diff = generate_diff ($ wanted , $ wanted_re , $ output );
2699
2697
}
2700
2698
2701
- // write .stdin
2702
- if ($ test ->hasSection ('STDIN ' ) || $ test ->hasSection ('PHPDBG ' )) {
2703
- $ stdin = $ test ->hasSection ('STDIN ' )
2704
- ? $ test ->getSection ('STDIN ' )
2705
- : $ test ->getSection ('PHPDBG ' ) . "\n" ;
2706
- if (file_put_contents ($ stdin_filename , $ stdin ) === false ) {
2707
- error ("Cannot create test stdin - $ stdin_filename " );
2708
- }
2709
- }
2710
-
2711
2699
if (is_array ($ IN_REDIRECT )) {
2712
2700
$ orig_shortname = str_replace (TEST_PHP_SRCDIR . '/ ' , '' , $ file );
2713
2701
$ diff = "# original source file: $ orig_shortname \n" . $ diff ;
@@ -2735,12 +2723,8 @@ function run_test(string $php, $file, array $env): string
2735
2723
if (!$ passed || $ leaked ) {
2736
2724
// write .sh
2737
2725
if (strpos ($ log_format , 'S ' ) !== false ) {
2738
- $ env_lines = [' unset $(env | cut -d= -f1) ' ];
2726
+ $ env_lines = [];
2739
2727
foreach ($ env as $ env_var => $ env_val ) {
2740
- if (strval ($ env_val ) === '' ) {
2741
- // proc_open does not pass empty env vars
2742
- continue ;
2743
- }
2744
2728
$ env_lines [] = "export $ env_var= " . escapeshellarg ($ env_val ?? "" );
2745
2729
}
2746
2730
$ exported_environment = "\n" . implode ("\n" , $ env_lines ) . "\n" ;
@@ -2749,7 +2733,7 @@ function run_test(string $php, $file, array $env): string
2749
2733
{$ exported_environment }
2750
2734
case "$1" in
2751
2735
"gdb")
2752
- gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' - -args {$ orig_cmd }
2736
+ gdb --args {$ orig_cmd }
2753
2737
;;
2754
2738
"lldb")
2755
2739
lldb -- {$ orig_cmd }
0 commit comments