1--TEST--
2fclose() actually closes streams with refcount > 1
3--FILE--
4<?php
5$s = fopen(__FILE__, "rb");
6function separate_zval(&$var) { }
7$s2 = $s;
8separate_zval($s2);
9fclose($s);
10echo fread($s2, strlen("<?php"));
11echo "\nDone.\n";
12--EXPECTF--
13Warning: fread(): %d is not a valid stream resource in %s on line %d
14
15Done.
16