child-process icon indicating copy to clipboard operation
child-process copied to clipboard

Looping closing a process from its pipes causes a critical error

Open 7-zete-7 opened this issue 4 months ago • 0 comments

Looping the process closing from its pipes causes a fatal error.

For complex chains with guaranteed closing, the following error may occur:

TypeError: proc_close(): Argument #1 ($process) must be of type resource, null given

/app/src/Process.php:312
...

This error occurs, for example, for the following code:

$process = new Process("...");
$process->start();
$process->stdout->on("close", [$process, "close"]); // through some chain
$process->close();

7-zete-7 avatar Aug 28 '25 11:08 7-zete-7