mirror of
https://github.com/php/php-src.git
synced 2024-12-27 19:00:27 +08:00
6b31413b13
in php_output_handler_op(): * if appending to buffer succeeds, just return HANDLER_NO_DATA and do nothing else * if a zero sized string or true is returned from the handler function, reset the context as well as the handler's buffer
26 lines
470 B
PHP
26 lines
470 B
PHP
--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
|
|
|