Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / standard / tests / streams / stream_copy_to_stream_socket.phpt
blob7e304b118890c272cfbc301aadc3344a7f9f6d61
1 --TEST--
2 stream_copy_to_stream() with socket as $source
3 --SKIPIF--
4 <?php
5 $sockets = @stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, 0);
6 if (!$sockets) die("skip stream_socket_pair");
7 ?>
8 --FILE--
9 <?php
11 $sockets = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, 0);
12 $tmp = tmpfile();
14 fwrite($sockets[0], b"a");
15 stream_socket_shutdown($sockets[0], STREAM_SHUT_WR);
16 stream_copy_to_stream($sockets[1], $tmp);
18 fseek($tmp, 0, SEEK_SET);
19 var_dump(stream_get_contents($tmp));
21 stream_copy_to_stream($sockets[1], $tmp);
23 fseek($tmp, 0, SEEK_SET);
24 var_dump(stream_get_contents($tmp));
28 --EXPECT--
29 string(1) "a"
30 string(1) "a"