summaryrefslogtreecommitdiff
path: root/tests/output/bug60768.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/output/bug60768.phpt')
-rw-r--r--tests/output/bug60768.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/output/bug60768.phpt b/tests/output/bug60768.phpt
new file mode 100644
index 0000000..2527e8e
--- /dev/null
+++ b/tests/output/bug60768.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #60768 Output buffer not discarded
+--FILE--
+<?php
+
+global $storage;
+
+ob_start(function($buffer) use (&$storage) { $storage .= $buffer; }, 20);
+
+echo str_repeat("0", 20); // fill in the buffer
+
+for($i = 0; $i < 10; $i++) {
+ echo str_pad($i, 9, ' ', STR_PAD_LEFT) . "\n"; // full buffer dumped every time
+}
+
+ob_end_flush();
+
+printf("Output size: %d, expected %d\n", strlen($storage), 20 + 10 * 10);
+
+?>
+DONE
+--EXPECT--
+Output size: 120, expected 120
+DONE
+