]> granicus.if.org Git - php/commitdiff
Change parameter default to always available value
authorChristoph M. Becker <cmbecker69@gmx.de>
Thu, 9 Apr 2020 12:51:55 +0000 (14:51 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Thu, 9 Apr 2020 14:15:47 +0000 (16:15 +0200)
`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
ext/standard/basic_functions_arginfo.h

index 3554b77feee248a6b8d3fe6e5ba3ac3199d39f59..e3f6e4146ef1f6b95dc31c352de6c3ad5e93fea7 100755 (executable)
@@ -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 {}
index 121380b7114b7c35739e69099bc4f5dd036a45eb..73fab38357927c4b603e426ff50ba54336145a04 100755 (executable)
@@ -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