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