php-src/ext/sockets/tests/socket_addrinfo_bind.phpt
David Walker 7373ce9149 Fix #72733: Expose getaddrinfo C function, and supporting connect/bind
Feature request was to expose getaddrinfo().  I accomplish this
by having an array of resources that are the addrinfo structures.
The resources can be used in new functions to connect/bind, and
one function to examine the contents of the resource.
2016-08-12 11:29:34 -06:00

19 lines
393 B
PHP

--TEST--
Test socket_addrinfo_bind()
--SKIPIF--
<?php
if (!extension_loaded('sockets')) {
die('SKIP The sockets extension is not loaded.');
}
--FILE--
<?php
$addrinfo = socket_addrinfo_lookup('127.0.0.1', 2000, array(
'ai_family' => AF_INET,
'ai_socktype' => SOCK_DGRAM,
));
var_dump(socket_addrinfo_bind($addrinfo[0]));
echo "Done";
--EXPECTF--
resource(%d) of type (Socket)
Done