1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00
Files
archived-php-src/ext/sockets/tests/socket_export_stream-1.phpt
T
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00

28 lines
542 B
PHP

--TEST--
socket_export_stream: Basic test
--SKIPIF--
<?php
if (!extension_loaded('sockets')) {
die('SKIP sockets extension not available.');
}
--FILE--
<?php
$domain = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? 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"