8000 Use try finally for restoring the error handler · symfony/symfony@3eca0b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3eca0b9

Browse files
ausiderrabus
andcommitted
Use try finally for restoring the error handler
Co-authored-by: Alexander M. Turek <me@derrabus.de>
1 parent f5fceb1 commit 3eca0b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,11 @@ public function start(callable $callback = null, array $env = []): void
344344

345345
return true;
346346
});
347-
$process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options);
348-
restore_error_handler();
347+
try {
348+
$process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options);
349+
} finally {
350+
restore_error_handler();
351+
}
349352

350353
if (!\is_resource($process)) {
351354
throw new RuntimeException('Unable to launch a new process: '.$lastError);

0 commit comments

Comments
 (0)
0