1--TEST--
2ext/sockets - socket_getsockname - basic test
3--CREDITS--
4Florian Anderiasch
5fa@php.net
6--SKIPIF--
7<?php
8    if (!extension_loaded('sockets')) {
9        die('skip sockets extension not available.');
10    }
11?>
12--FILE--
13<?php
14    $s_c     = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
15    $s_bind  = socket_bind($s_c, '0.0.0.0');
16    var_dump($s_bind);
17
18    // Connect to destination address
19    $s_conn  = socket_getsockname($s_c, $ip, $port);
20    var_dump($s_conn);
21    var_dump($ip);
22    var_dump($port);
23    socket_close($s_c);
24?>
25--EXPECTF--
26bool(true)
27bool(true)
28string(7) "0.0.0.0"
29int(%i)
30