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