1--TEST--
2Bug GH-9590 001 (stream_select does not abort upon exception or empty valid fd set)
3--SKIPIF--
4<?php
5if (!function_exists('posix_setrlimit') || !posix_setrlimit(POSIX_RLIMIT_NOFILE, 2048, -1)) {
6    die('skip Failed to set POSIX_RLIMIT_NOFILE');
7}
8?>
9--FILE--
10<?php
11
12posix_setrlimit(POSIX_RLIMIT_NOFILE, 2048, -1);
13
14$fds = [];
15for ($i = 0; $i < 1023; $i++) {
16    $fds[] = @fopen(__DIR__ . "/GH-9590-001-tmpfile.$i", 'w');
17}
18
19list($a, $b) = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP);
20
21$r = [$a];
22$w = $e = [];
23var_dump(stream_select($r, $w, $e, PHP_INT_MAX));
24
25?>
26--EXPECTF--
27Warning: stream_select(): You MUST recompile PHP with a larger value of FD_SETSIZE.
28It is set to 1024, but you have descriptors numbered at least as high as %d.
29 --enable-fd-setsize=%d is recommended, but you may want to set it
30to equal the maximum number of open files supported by your system,
31in order to avoid seeing this error again at a later date. in %s on line %d
32bool(false)
33--CLEAN--
34<?php
35for ($i = 0; $i < 1023; $i++) {
36    @unlink(__DIR__ . "/GH-9590-001-tmpfile.$i");
37}
38?>
39