We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db9776c commit f720fb1Copy full SHA for f720fb1
ext/standard/tests/streams/bug78902.phpt
@@ -0,0 +1,30 @@
1
+--TEST--
2
+Bug #78902: Memory leak when using stream_filter_append
3
+--XFAIL--
4
+This bug was introduced in PHP 7.3.11 an is still open
5
+--INI--
6
+memory_limit=512k
7
+--FILE--
8
+<?php
9
+
10
+/** create temporary file 2mb file */
11
+$tmp_file_name = tempnam(sys_get_temp_dir(), 'test_');
12
+$fp = fopen($tmp_file_name, 'w+');
13
+$size = 1024 * 1024 * 2; // 2mb
14
+$chunk = 1024;
15
+while ($size > 0) {
16
+ fputs($fp, str_pad('', min($chunk,$size)));
17
+ $size -= $chunk;
18
+}
19
+fclose($fp);
20
21
+$fp = fopen($tmp_file_name, 'r');
22
+stream_filter_append($fp, "string.toupper");
23
+while (!feof($fp)) {
24
+ fread($fp, 1);
25
26
27
+var_dump(true);
28
+?>
29
+--EXPECT--
30
+bool(true)
0 commit comments