1--TEST--
2Testing socket_get_status()
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
15var_dump(socket_get_status($server));
16fclose($server);
17
18?>
19--EXPECTF--
20array(7) {
21  ["timed_out"]=>
22  bool(false)
23  ["blocked"]=>
24  bool(true)
25  ["eof"]=>
26  bool(false)
27  ["stream_type"]=>
28  string(%d) "tcp_socket%S"
29  ["mode"]=>
30  string(2) "r+"
31  ["unread_bytes"]=>
32  int(0)
33  ["seekable"]=>
34  bool(false)
35}
36