php-src/ext/sockets/tests/socket_export_stream-5.phpt

26 lines
613 B
Plaintext
Raw Normal View History

2014-08-06 15:22:56 +00:00
--TEST--
socket_export_stream: effects of leaked handles
--SKIPIF--
<?php
if (!extension_loaded('sockets')) {
die('SKIP sockets extension not available.');
}
if (!function_exists('leak_variable'))
die('SKIP only for debug builds');
--FILE--
<?php
$sock0 = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($sock0, '0.0.0.0', 58380);
$stream0 = socket_export_stream($sock0);
leak_variable($stream0, true);
$sock1 = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($sock1, '0.0.0.0', 58381);
$stream1 = socket_export_stream($sock1);
leak_variable($sock1, true);
echo "Done.\n";
--EXPECT--
Done.