From: Gustavo André dos Santos Lopes <cataphract@php.net>
Date: Mon, 15 Nov 2010 14:51:26 +0000 (+0000)
Subject: - Added test relative to the fix in rev #305346.
X-Git-Tag: php-5.4.0alpha1~191^2~670
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3727cc86232eaa7072ed80323fa7f6a3ff30ee4;p=php

- Added test relative to the fix in rev #305346.
---

diff --git a/ext/standard/tests/file/stream_enclosed.phpt b/ext/standard/tests/file/stream_enclosed.phpt
new file mode 100644
index 0000000000..9520ecce74
--- /dev/null
+++ b/ext/standard/tests/file/stream_enclosed.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Unexposed/leaked stream encloses another stream
+--SKIPIF--
+<?php
+if (!function_exists('leak_variable')) die("skip only debug builds");
+--FILE--
+<?php
+$s = fopen('php://temp/maxmemory=1024','wb+');
+
+$t = fopen('php://temp/maxmemory=1024','wb+');
+
+/* force conversion of inner stream to STDIO. */
+$i = 0;
+while ($i++ < 5000) {
+    fwrite($t, str_repeat('a',1024));
+}
+
+leak_variable($s, true);
+leak_variable($t, true);
+--EXPECT--