[php-src] master: Revert "ext/standard/tests: work around Windows quoting with tempfiles."

From: Date: Thu, 15 Oct 2026 00:25:14 +0000
Subject: [php-src] master: Revert "ext/standard/tests: work around Windows quoting with tempfiles."
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142295@lists.php.net to get a copy of this message
Author: Gina Peter Banyard (Girgias) Date: 2026-10-15T01:24:02+01:00 Commit: https://github.com/php/php-src/commit/2ef52700537f6bfbb0bb92ee1debdd5d0485206f Raw diff: https://github.com/php/php-src/commit/2ef52700537f6bfbb0bb92ee1debdd5d0485206f.diff Revert "ext/standard/tests: work around Windows quoting with tempfiles." This reverts commit 077d7d6024f7bb7b1183fdae51745880abac76a6. As it breaks tests in 8.5 and above. Changed paths: M ext/standard/tests/general_functions/proc_open_null.phpt M ext/standard/tests/general_functions/proc_open_redirect.phpt Diff: diff --git a/ext/standard/tests/general_functions/proc_open_null.phpt b/ext/standard/tests/general_functions/proc_open_null.phpt index 6c869725dd23..f5ea603f04b8 100644 --- a/ext/standard/tests/general_functions/proc_open_null.phpt +++ b/ext/standard/tests/general_functions/proc_open_null.phpt @@ -5,9 +5,7 @@ Null pipes in proc_open() $php = getenv('TEST_PHP_EXECUTABLE'); $args = getenv('TEST_PHP_EXTRA_ARGS'); -$fn = tempnam(sys_get_temp_dir(), "PROC_OPEN_TEST"); -$cmd = "$php $args " . escapeshellarg($fn); -file_put_contents($fn, '<?php echo "Test"; fprintf(STDERR, "Error");'); +$cmd = "$php $args -r 'echo \"Test\"; fprintf(STDERR, \"Error\");'"; $proc = proc_open($cmd, [1 => ['null'], 2 => ['pipe', 'w']], $pipes); var_dump($pipes); @@ -18,17 +16,16 @@ $proc = proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['null']], $pipes); var_dump($pipes); var_dump(stream_get_contents($pipes[1])); proc_close($proc); -unlink($fn); ?> --EXPECT-- array(1) { [2]=> - resource(6) of type (stream) + resource(4) of type (stream) } string(5) "Error" array(1) { [1]=> - resource(8) of type (stream) + resource(6) of type (stream) } string(4) "Test" diff --git a/ext/standard/tests/general_functions/proc_open_redirect.phpt b/ext/standard/tests/general_functions/proc_open_redirect.phpt index add5e6031ee5..c8d29e894776 100644 --- a/ext/standard/tests/general_functions/proc_open_redirect.phpt +++ b/ext/standard/tests/general_functions/proc_open_redirect.phpt @@ -26,9 +26,7 @@ try { } echo "\nWith pipe:\n"; -$fn = tempnam(sys_get_temp_dir(), "PROC_OPEN_TEST"); -file_put_contents($fn, '<?php echo "Test\n"; fprintf(STDERR, "Error");'); -$cmd = "$php $args " . escapeshellarg($fn); +$cmd = "$php $args -r 'echo \"Test\n\"; fprintf(STDERR, \"Error\");'"; $proc = proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['redirect', 1]], $pipes); var_dump($pipes); var_dump(stream_get_contents($pipes[1])); @@ -54,7 +52,6 @@ unlink($fileName); echo "\nWith inherited stdout:\n"; $proc = proc_open($cmd, [2 => ['redirect', 1]], $pipes); proc_close($proc); -unlink($fn); ?> --EXPECTF-- @@ -66,7 +63,7 @@ Warning: proc_open(): Redirection target 42 not found in %s With pipe: array(1) { [1]=> - resource(6) of type (stream) + resource(4) of type (stream) } string(10) "Test Error"

« previous php.cvs (#142295) next »