From 62e8dcbc48a8f3e391cf0b111dcb3e0d708be104 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 9 Apr 2020 14:51:55 +0200 Subject: [PATCH] Change parameter default to always available value `SIGTERM` is only defined in ext/pcntl, and as such never available on Windows. Moving the constant to ext/standard does not make much sense, because that parameter is actually unused on Windows. Therefore, we use the magic number `15` instead, what is also done in the PHP manual. --- ext/standard/basic_functions.stub.php | 2 +- ext/standard/basic_functions_arginfo.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 3554b77fee..e3f6e4146e 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1175,7 +1175,7 @@ function proc_open($cmd, array $descriptorspec, &$pipes, ?string $cwd = null, ?a function proc_close($process): int {} /** @param resource $process */ -function proc_terminate($process, int $signal = SIGTERM): bool {} +function proc_terminate($process, int $signal = 15): bool {} /** @param resource $process */ function proc_get_status($process): array {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 121380b711..73fab38357 100755 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1805,7 +1805,7 @@ ZEND_END_ARG_INFO() #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_terminate, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, process) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, signal, IS_LONG, 0, "SIGTERM") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, signal, IS_LONG, 0, "15") ZEND_END_ARG_INFO() #endif -- 2.50.1