1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/standard/tests/general_functions/gh12655.phpt
2023-11-13 19:29:44 +01:00

23 lines
672 B
PHP

--TEST--
GH-12655 (proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams [Descriptor item must be either an array or a File-Handle])
--FILE--
<?php
$descriptor_spec = [
0 => [ "pipe", "r" ], // stdin is a pipe that the child will read from
1 => [ "pipe", "w" ], // stdout is a pipe that the child will write to
2 => [ "pipe", "w" ], // stderr is a file to write to
];
foreach ( $descriptor_spec as $fd => &$d )
{
// don't do anything, just the fact that we used "&$d" will sink the ship!
}
$proc = proc_open(PHP_BINARY, $descriptor_spec, $pipes);
echo $proc === false ? "FAILED\n" : "SUCCEEDED\n";
?>
--EXPECT--
SUCCEEDED