Skip to content

Commit 8867cfa

Browse files
committed
ext/pcntl: Fix pcntl_setcpuaffinity exception type for invalid cpu id.
found while working [on the doc](php/doc-en#4346).
1 parent b1e0176 commit 8867cfa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/pcntl/pcntl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
17211721
cpu = (zend_long)tmp;
17221722
} else {
17231723
zend_string *wcpu = zval_get_string_func(ncpu);
1724-
zend_argument_value_error(2, "cpu id invalid type (%s)", ZSTR_VAL(wcpu));
1724+
zend_argument_type_error(2, "cpu id invalid type (%s)", ZSTR_VAL(wcpu));
17251725
zend_string_release(wcpu);
17261726
PCNTL_CPU_DESTROY(mask);
17271727
RETURN_THROWS();

ext/pcntl/tests/pcntl_cpuaffinity.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ try {
4848

4949
try {
5050
pcntl_setcpuaffinity(null, [1, array(1)]);
51-
} catch (\ValueError $e) {
51+
} catch (\TypeError $e) {
5252
echo $e->getMessage();
5353
}
5454
?>

0 commit comments

Comments
 (0)