mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
26 lines
613 B
Plaintext
26 lines
613 B
Plaintext
|
--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.
|