$env += '\\' === \DIRECTORY_SEPARATOR ?
array_diff_ukey($this->
getDefaultEnv(),
$env, 'strcasecmp'
) :
$this->
getDefaultEnv();
if (\
is_array($commandline =
$this->commandline
)) { $commandline =
implode(' ',
array_map($this->
escapeArgument(...
),
$commandline));
if ('\\' !== \DIRECTORY_SEPARATOR
) { // exec is mandatory to deal with sending a signal to the process
$commandline = 'exec '.
$commandline;
} } else { $commandline =
$this->
replacePlaceholders($commandline,
$env);
} if ('\\' === \DIRECTORY_SEPARATOR
) { $commandline =
$this->
prepareWindowsCommandLine($commandline,
$env);
} elseif (!
$this->useFileHandles &&
$this->
isSigchildEnabled()) { // last exit code is output on the fourth pipe and caught to work around --enable-sigchild
$descriptors[3
] =
['pipe', 'w'
];
// See https://unix.stackexchange.com/questions/71205/background-process-pipe-input
$commandline = '{ ('.
$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;';
$commandline .= 'pid=$!; echo $pid >&3; wait $pid 2>/dev/null; code=$?; echo $code >&3; exit $code';