Skip to content

Commit 951d2f8

Browse files
committed
Merge branch 'PHP-8.4'
2 parents effd3f6 + 6979a7a commit 951d2f8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

ext/pcntl/pcntl.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,9 +1727,7 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
17271727

17281728
cpu = (zend_long)tmp;
17291729
} else {
1730-
zend_string *wcpu = zval_get_string_func(ncpu);
1731-
zend_argument_value_error(2, "cpu id invalid type (%s)", ZSTR_VAL(wcpu));
1732-
zend_string_release(wcpu);
1730+
zend_argument_type_error(2, "value must be of type int|string, %s given", zend_zval_value_name(ncpu));
17331731
PCNTL_CPU_DESTROY(mask);
17341732
RETURN_THROWS();
17351733
}

ext/pcntl/tests/pcntl_cpuaffinity.phpt

Lines changed: 2 additions & 4 deletions
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
?>
@@ -64,6 +64,4 @@ pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid value (def)
6464
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (%d)
6565
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (-1024)
6666
pcntl_getcpuaffinity(): Argument #1 ($process_id) invalid process (-1024)
67-
68-
Warning: Array to string conversion in %s on line %d
69-
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid type (Array)
67+
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) value must be of type int|string, array given

0 commit comments

Comments
 (0)