1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/posix/tests/posix_kill_pidoverflow.phpt

26 lines
619 B
PHP

--TEST--
posix_kill() with large pid
--EXTENSIONS--
posix
pcntl
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
// with pid overflow, it ends up being -1 which means all permissible processes are affected
try {
posix_kill(PHP_INT_MAX, SIGTERM);
} catch (\ValueError $e) {
echo $e->getMessage(), PHP_EOL;
}
try {
posix_kill(PHP_INT_MIN, SIGTERM);
} catch (\ValueError $e) {
echo $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
posix_kill(): Argument #1 ($process_id) must be between %i and %d
posix_kill(): Argument #1 ($process_id) must be between %i and %d