1--TEST--
2ext/sockets - socket_getpeername - basic test
3--CREDITS--
4Florian Anderiasch
5fa@php.net
6--EXTENSIONS--
7sockets
8--FILE--
9<?php
10    $s_c     = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
11    $s_bind  = socket_bind($s_c, '0.0.0.0');
12    var_dump($s_bind);
13
14    // Connect to destination address
15    $s_peer  = socket_getpeername($s_c, $ip, $port);
16    var_dump($s_peer);
17    var_dump($ip);
18    var_dump($port);
19    socket_close($s_c);
20?>
21--EXPECTF--
22bool(true)
23
24Warning: socket_getpeername(): unable to retrieve peer name [%i]: %a in %s on line %d
25bool(false)
26NULL
27NULL
28