bug60768.phpt 469 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #60768 Output buffer not discarded
  3. --FILE--
  4. <?php
  5. global $storage;
  6. ob_start(function($buffer) use (&$storage) { $storage .= $buffer; }, 20);
  7. echo str_repeat("0", 20); // fill in the buffer
  8. for($i = 0; $i < 10; $i++) {
  9. echo str_pad($i, 9, ' ', STR_PAD_LEFT) . "\n"; // full buffer dumped every time
  10. }
  11. ob_end_flush();
  12. printf("Output size: %d, expected %d\n", strlen($storage), 20 + 10 * 10);
  13. ?>
  14. DONE
  15. --EXPECT--
  16. Output size: 120, expected 120
  17. DONE