mirror of
https://github.com/php/php-src.git
synced 2024-10-01 14:56:10 +00:00
7f2937223d
This reverts the fix for bug #24557. - Make php_stream_free delete the stream from the resources list, not merely decrease its refcount, as a single call to zend_list_delete does. #Not worth the risk merging to 5.3. While change #2 may prevent some segfaults, #a quick and dirty survey to the codebase only showed calls to php_stream_close #or php_stream_free on streams allocated in the same function, which would have #refcount == 1. May be reconsidered.
16 lines
319 B
PHP
16 lines
319 B
PHP
--TEST--
|
|
fclose() actually closes streams with refcount > 1
|
|
--FILE--
|
|
<?php
|
|
$s = fopen(__FILE__, "rb");
|
|
function separate_zval(&$var) { }
|
|
$s2 = $s;
|
|
separate_zval($s2);
|
|
fclose($s);
|
|
echo fread($s2, strlen("<?php"));
|
|
echo "\nDone.\n";
|
|
--EXPECTF--
|
|
Warning: fread(): %d is not a valid stream resource in %s on line %d
|
|
|
|
Done.
|