1--TEST--
2Testing fread() on a TCP server socket
3--FILE--
4<?php
5
6for ($i=0; $i<100; $i++) {
7  $port = rand(10000, 65000);
8  /* Setup socket server */
9  $server = @stream_socket_server("tcp://127.0.0.1:$port");
10  if ($server) {
11    break;
12  }
13}
14
15socket_set_timeout($server, 0, 1000);
16
17var_dump(fread($server, 1));
18
19fclose($server);
20
21?>
22--EXPECT--
23bool(false)
24