mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
528aa7932a
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.
24 lines
608 B
PHP
24 lines
608 B
PHP
--TEST--
|
|
socket_import_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
|
|
|
|
$stream0 = stream_socket_server("udp://0.0.0.0:0", $errno, $errstr, STREAM_SERVER_BIND);
|
|
$sock0 = socket_import_stream($stream0);
|
|
zend_leak_variable($stream0);
|
|
|
|
$stream1 = stream_socket_server("udp://0.0.0.0:0", $errno, $errstr, STREAM_SERVER_BIND);
|
|
$sock1 = socket_import_stream($stream1);
|
|
zend_leak_variable($sock1);
|
|
|
|
echo "Done.\n";
|
|
--EXPECT--
|
|
Done.
|