1--TEST--
2Unexposed/leaked stream encloses another stream
3--SKIPIF--
4<?php
5if (!function_exists('leak_variable')) die("skip only debug builds");
6--FILE--
7<?php
8$s = fopen('php://temp/maxmemory=1024','wb+');
9
10$t = fopen('php://temp/maxmemory=1024','wb+');
11
12/* force conversion of inner stream to STDIO. */
13$i = 0;
14while ($i++ < 5000) {
15    fwrite($t, str_repeat('a',1024));
16}
17
18leak_variable($s, true);
19leak_variable($t, true);
20--EXPECT--
21