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