1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Files
archived-php-src/ext/curl/tests/bug52827.phpt
Nikita Popov 39131219e8 Migrate more SKIPIF -> EXTENSIONS (#7139)
This is a mix of more automated and manual migration. It should remove all applicable extension_loaded() checks outside of skipif.inc files.
2021-06-11 12:58:44 +02:00

28 lines
743 B
PHP

--TEST--
Bug #52827 (curl_setopt with CURLOPT_STDERR erroneously increments the resource refcount)
--EXTENSIONS--
curl
--FILE--
<?php
$s = fopen('php://temp/maxmemory=1024','wb+');
/* force conversion of inner stream to STDIO.
* This is not necessary in Windows because the
* cast to a FILE* handle in curl_setopt already
* forces the conversion in that platform. The
* reason for this conversion is that the memory
* stream has an ugly but working mechanism to
* prevent being double freed when it's encapsulated,
* while STDIO streams don't. */
$i = 0;
while ($i++ < 5000) {
fwrite($s, str_repeat('a',1024));
}
$handle=curl_init('http://www.example.com');
curl_setopt($handle, CURLOPT_STDERR, $s);
echo "Done.";
?>
--EXPECT--
Done.