repo.or.cz
/
hiphop-php.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
import non-predictable number tests
[hiphop-php.git]
/
hphp
/
test
/
zend
/
good
/
ext-sockets
/
socket_getsockname.php
blob
afd9c422a6f11a7ac05962d458b8a3c689f416e1
1
<
?php
2
$rand
=
rand
(
1
,
999
);
3
$s_c
=
socket_create
(
AF_INET
,
SOCK_STREAM
,
SOL_TCP
);
4
$s_bind
=
socket_bind
(
$s_c
,
'0.0.0.0'
,
31330
+
$rand
);
5
var_dump
(
$s_bind
);
6
7
// Connect to destination address
8
$s_conn
=
socket_getsockname
(
$s_c
,
$ip
,
$port
);
9
var_dump
(
$s_conn
);
10
var_dump
(
$ip
);
11
var_dump
(
$port
);
12
socket_close
(
$s_c
);
13
?
>