summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug52820.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/file/bug52820.phpt')
-rw-r--r--ext/standard/tests/file/bug52820.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt
index b398cc4b8..3b7ed3ec3 100644
--- a/ext/standard/tests/file/bug52820.phpt
+++ b/ext/standard/tests/file/bug52820.phpt
@@ -2,6 +2,8 @@
Bug #52820 (writes to fopencookie FILE* not commited when seeking the stream)
--SKIPIF--
<?php
+if (!function_exists('leak_variable'))
+ die("skip only for debug builds");
/* unfortunately no standard function does a cast to FILE*, so we need
* curl to test this */
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
@@ -30,6 +32,12 @@ fclose(do_stuff("php://temp"));
echo "\nmemory stream (close after):\n";
fclose(do_stuff("php://memory"));
+echo "\ntemp stream (leak):\n";
+leak_variable(do_stuff("php://temp"), true);
+
+echo "\nmemory stream (leak):\n";
+leak_variable(do_stuff("php://memory"), true);
+
echo "\nDone.\n";
--EXPECT--
temp stream (close after):
@@ -46,4 +54,18 @@ About to rewind!
* couldn't connect to host
* Closing connection #0
+temp stream (leak):
+About to rewind!
+* About to connect() to 127.0.0.1 port 37349 (#0)
+* Trying 127.0.0.1... * Connection refused
+* couldn't connect to host
+* Closing connection #0
+
+memory stream (leak):
+About to rewind!
+* About to connect() to 127.0.0.1 port 37349 (#0)
+* Trying 127.0.0.1... * Connection refused
+* couldn't connect to host
+* Closing connection #0
+
Done.