1--TEST--
2Non-finite timeout values in stream functions
3--FILE--
4<?php
5$socket = stream_socket_server("tcp://0.0.0.0:14781", $errno, $errstr);
6foreach ([NAN, -NAN, INF, -INF] as $value) {
7    try {
8        stream_socket_accept($socket, $value);
9    } catch (ValueError $e) {
10        echo $e->getMessage(), "\n";
11    }
12}
13fclose($socket);
14
15foreach ([NAN, -NAN, INF, -INF] as $value) {
16    try {
17        stream_socket_client("tcp://0.0.0.0:14781", timeout: $value);
18    } catch (ValueError $e) {
19        echo $e->getMessage(), "\n";
20    }
21}
22?>
23--EXPECT--
24stream_socket_accept(): Argument #2 ($timeout) must be a finite value
25stream_socket_accept(): Argument #2 ($timeout) must be a finite value
26stream_socket_accept(): Argument #2 ($timeout) must be a finite value
27stream_socket_accept(): Argument #2 ($timeout) must be a finite value
28stream_socket_client(): Argument #4 ($timeout) must be a finite value
29stream_socket_client(): Argument #4 ($timeout) must be a finite value
30stream_socket_client(): Argument #4 ($timeout) must be a finite value
31stream_socket_client(): Argument #4 ($timeout) must be a finite value
32