diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index e9ed59c8175f2..cce1d7bb79754 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -110,8 +110,6 @@ rem generate php.ini echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini if "%OPCACHE%" equ "1" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini -rem work-around for some spawned PHP processes requiring OpenSSL -echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini rem remove ext dlls for which tests are not supported for %%i in (imap ldap oci8_12c pdo_firebird pdo_oci snmp) do ( diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt index 0236e9e1ea7c7..344e146d6ca60 100644 --- a/ext/standard/tests/file/bug60120.phpt +++ b/ext/standard/tests/file/bug60120.phpt @@ -16,7 +16,7 @@ $php = getenv('TEST_PHP_EXECUTABLE'); if (!$php) { die("No php executable defined\n"); } -$cmd = 'php -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; +$cmd = $php . ' -r "\$in = file_get_contents(\'php://stdin\'); fwrite(STDOUT, \$in); fwrite(STDERR, \$in);"'; $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); $stdin = str_repeat('*', 2049 ); @@ -32,6 +32,7 @@ $stdinOffset = 0; unset($pipes[0]); +$procOutput = []; while ($pipes || $writePipes) { $r = $pipes; $w = $writePipes; @@ -48,6 +49,8 @@ while ($pipes || $writePipes) { $written = fwrite($writePipes[0], substr($stdin, $stdinOffset), 8192); if (false !== $written) { $stdinOffset += $written; + } else { + die('Failed to write to pipe'); } if ($stdinOffset >= $stdinLen) { fclose($writePipes[0]); @@ -58,12 +61,21 @@ while ($pipes || $writePipes) { foreach ($r as $pipe) { $type = array_search($pipe, $pipes); $data = fread($pipe, 8192); - if (false === $data || feof($pipe)) { + if (feof($pipe)) { fclose($pipe); unset($pipes[$type]); + } elseif (false === $data) { + die('Failed to read from pipe'); + } else { + $procOutput[$type] = ($procOutput[$type] ?? '') . $data; } } } +foreach ($procOutput as $output) { + if ($output !== $stdin) { + die('Output does not match input: ' . $output); + } +} echo "OK."; ?> --EXPECT--