php-src/ext/sockets/tests/socket_export_stream-5.phpt
Nikita Popov 528aa7932a Use zero port in socket_(export|import)_stream-5.phpt
These regularly fail due to port clashes, though we don't seem to
use those ports in any other tests.

As we don't care about the specific port that is used here, pass
zero so that a random ephemeral port is used.
2019-06-05 11:58:11 +02:00

26 lines
608 B
PHP

--TEST--
socket_export_stream: effects of leaked handles
--SKIPIF--
<?php
if (!extension_loaded('sockets')) {
die('SKIP sockets extension not available.');
}
if (!function_exists('zend_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', 0);
$stream0 = socket_export_stream($sock0);
zend_leak_variable($stream0);
$sock1 = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($sock1, '0.0.0.0', 0);
$stream1 = socket_export_stream($sock1);
zend_leak_variable($sock1);
echo "Done.\n";
--EXPECT--
Done.