Skip to content

Commit

Permalink
Merge branch 'PHP-8.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jan 15, 2025
2 parents effd3f6 + 6979a7a commit 951d2f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions ext/pcntl/pcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1727,9 +1727,7 @@ PHP_FUNCTION(pcntl_setcpuaffinity)

cpu = (zend_long)tmp;
} else {
zend_string *wcpu = zval_get_string_func(ncpu);
zend_argument_value_error(2, "cpu id invalid type (%s)", ZSTR_VAL(wcpu));
zend_string_release(wcpu);
zend_argument_type_error(2, "value must be of type int|string, %s given", zend_zval_value_name(ncpu));
PCNTL_CPU_DESTROY(mask);
RETURN_THROWS();
}
Expand Down
6 changes: 2 additions & 4 deletions ext/pcntl/tests/pcntl_cpuaffinity.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ try {

try {
pcntl_setcpuaffinity(null, [1, array(1)]);
} catch (\ValueError $e) {
} catch (\TypeError $e) {
echo $e->getMessage();
}
?>
Expand All @@ -64,6 +64,4 @@ pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid value (def)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (%d)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (-1024)
pcntl_getcpuaffinity(): Argument #1 ($process_id) invalid process (-1024)

Warning: Array to string conversion in %s on line %d
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid type (Array)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) value must be of type int|string, array given

0 comments on commit 951d2f8

Please sign in to comment.