bug46897.phpt 820 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #46897: ob_flush() should fail to flush unerasable buffers
  3. --FILE--
  4. <?php
  5. function callback($string) {
  6. static $callback_invocations;
  7. $callback_invocations++;
  8. return "[callback:$callback_invocations]$string\n";
  9. }
  10. ob_start('callback', 0, false);
  11. echo "Attempt to flush unerasable buffer - should fail...";
  12. var_dump(ob_flush());
  13. // Check content of buffer after flush - if flush failed it should still contain the string above.
  14. var_dump(ob_get_contents());
  15. echo 'Done';
  16. ?>
  17. --EXPECTF--
  18. [callback:1]Attempt to flush unerasable buffer - should fail...
  19. Notice: ob_flush(): Failed to flush buffer of callback (0) in %s on line %d
  20. bool(false)
  21. string(%d) "Attempt to flush unerasable buffer - should fail...
  22. Notice: ob_flush(): Failed to flush buffer of callback (0) in %s on line %d
  23. bool(false)
  24. "
  25. Done