1--TEST--
2Test socket_addrinfo_explain()
3--SKIPIF--
4<?php
5if (!extension_loaded('sockets')) {
6    die('SKIP The sockets extension is not loaded.');
7}
8--FILE--
9<?php
10$addrinfo = socket_addrinfo_lookup('127.0.0.1', 2000, array(
11    'ai_family' => AF_INET,
12    'ai_socktype' => SOCK_DGRAM,
13));
14var_dump(socket_addrinfo_explain($addrinfo[0]));
15echo "Done";
16--EXPECTF--
17array(5) {
18  ["ai_flags"]=>
19  int(%d)
20  ["ai_family"]=>
21  int(2)
22  ["ai_socktype"]=>
23  int(2)
24  ["ai_protocol"]=>
25  int(%d)
26  ["ai_addr"]=>
27  array(2) {
28    ["sin_port"]=>
29    int(2000)
30    ["sin_addr"]=>
31    string(9) "127.0.0.1"
32  }
33}
34Done
35