Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / standard / tests / streams / stream_socket_pair.phpt
blob203ae982d1c211113248ebd6147e8d27799aca16
1 --TEST--
2 stream_socket_pair()
3 --FILE--
4 <?php
5 $domain = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? STREAM_PF_INET : STREAM_PF_UNIX);
6 $sockets = stream_socket_pair($domain, STREAM_SOCK_STREAM, 0);
7 var_dump($sockets);
8 fwrite($sockets[0], b"foo");
9 var_dump(fread($sockets[1], strlen(b"foo")));
10 fclose($sockets[0]);
12 --EXPECTF--
13 array(2) {
14   [0]=>
15   resource(%d) of type (stream)
16   [1]=>
17   resource(%d) of type (stream)
19 string(3) "foo"