@@ -304,7 +304,7 @@ public function start(callable $callback = null, array $env = [])
304
304
$ this ->resetProcessData ();
305
305
$ this ->starttime = $ this ->lastOutputTime = microtime (true );
306
306
$ this ->callback = $ this ->buildCallback ($ callback );
307
- $ descriptors = $ this ->getDescriptors ();
307
+ $ descriptors = $ this ->getDescriptors (null !== $ callback );
308
308
309
309
if ($ this ->env ) {
310
310
$ env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey ($ this ->env , $ env , 'strcasecmp ' ) : $ this ->env ;
@@ -1240,15 +1240,15 @@ public static function isPtySupported(): bool
1240
1240
/**
1241
1241
* Creates the descriptors needed by the proc_open.
1242
1242
*/
1243
- private function getDescriptors (): array
1243
+ private function getDescriptors (bool $ hasCallback ): array
1244
1244
{
1245
1245
if ($ this ->input instanceof \Iterator) {
1246
1246
$ this ->input ->rewind ();
1247
1247
}
1248
1248
if ('\\' === \DIRECTORY_SEPARATOR ) {
1249
- $ this ->processPipes = new WindowsPipes ($ this ->input , !$ this ->outputDisabled || $ this -> callback );
1249
+ $ this ->processPipes = new WindowsPipes ($ this ->input , !$ this ->outputDisabled || $ hasCallback );
1250
1250
} else {
1251
- $ this ->processPipes = new UnixPipes ($ this ->isTty (), $ this ->isPty (), $ this ->input , !$ this ->outputDisabled || $ this -> callback );
1251
+ $ this ->processPipes = new UnixPipes ($ this ->isTty (), $ this ->isPty (), $ this ->input , !$ this ->outputDisabled || $ hasCallback );
1252
1252
}
1253
1253
1254
1254
return $ this ->processPipes ->getDescriptors ();
0 commit comments