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/sockets/tests/socket_sendto_invalid_port.phpt
David Carlier 665ebd7f48 ext/sockets: socket_sendto check port range.
close GH-17299
2024-12-29 19:07:19 +00:00

23 lines
610 B
PHP

--TEST--
socket_sendto() with invalid port
--EXTENSIONS--
sockets
--FILE--
<?php
$s_c = socket_create_listen(0);
try {
$s_w = socket_sendto($s_c, "foo", 0, MSG_OOB, '127.0.0.1', 65536);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
$s_w = socket_sendto($s_c, "foo", 0, MSG_OOB, '127.0.0.1', -1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
socket_close($s_c);
?>
--EXPECT--
socket_sendto(): Argument #6 ($port) must be between 0 and 65535
socket_sendto(): Argument #6 ($port) must be between 0 and 65535