summaryrefslogtreecommitdiff
path: root/ext/sockets/tests/socket_import_stream-5.phpt
blob: 5eaf579854499cc5eee45bd1c56f2ced70fea31b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--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');
?>
--INI--
report_memleaks=0
--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.