1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/sockets/tests/socket_export_stream-1.phpt
2025-06-23 14:56:53 +02:00

25 lines
446 B
PHP

--TEST--
socket_export_stream: Basic test
--EXTENSIONS--
sockets
--FILE--
<?php
$domain = PHP_OS_FAMILY == 'Windows' ? AF_INET : AF_UNIX;
socket_create_pair($domain, SOCK_STREAM, 0, $s);
$s0 = reset($s);
$s1 = next($s);
$stream = socket_export_stream($s0);
var_dump($stream);
socket_write($s1, "test message");
socket_close($s1);
var_dump(stream_get_contents($stream));
?>
--EXPECTF--
resource(%d) of type (stream)
string(12) "test message"