1--TEST--
2GH-14780: p(f)sockopen overflow on timeout.
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6?>
7--FILE--
8<?php
9$code = null;
10$err = null;
11try {
12	pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MAX/100000)+1);
13} catch (\ValueError $e) {
14	echo $e->getMessage() . PHP_EOL;
15}
16try {
17	pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MIN/100000)-1);
18} catch (\ValueError $e) {
19	echo $e->getMessage() . PHP_EOL;
20}
21var_dump(pfsockopen('udp://127.0.0.1', '63844', $code, $err, -1));
22try {
23	pfsockopen('udp://127.0.0.1', '63844', $code, $err, NAN);
24} catch (\ValueError $e) {
25	echo $e->getMessage() . PHP_EOL;
26}
27try {
28	pfsockopen('udp://127.0.0.1', '63844', $code, $err, INF);
29} catch (\ValueError $e) {
30	echo $e->getMessage();
31}
32?>
33--EXPECTF--
34pfsockopen(): Argument #6 must be -1 or between 0 and %s
35pfsockopen(): Argument #6 must be -1 or between 0 and %s
36resource(%d) of type (persistent stream)
37pfsockopen(): Argument #6 must be -1 or between 0 and %s
38pfsockopen(): Argument #6 must be -1 or between 0 and %s
39