1--TEST--
2socket_export_stream: Basic test
3--EXTENSIONS--
4sockets
5--FILE--
6<?php
7
8$domain = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? AF_INET : AF_UNIX);
9socket_create_pair($domain, SOCK_STREAM, 0, $s);
10
11$s0 = reset($s);
12$s1 = next($s);
13
14$stream = socket_export_stream($s0);
15var_dump($stream);
16
17socket_write($s1, "test message");
18socket_close($s1);
19
20var_dump(stream_get_contents($stream));
21?>
22--EXPECTF--
23resource(%d) of type (stream)
24string(12) "test message"
25