ob_start_basic_unerasable_001.phpt 500 B

12345678910111213141516171819202122
  1. --TEST--
  2. ob_start(): Ensure content of unerasable buffer can be accessed by ob_get_contents().
  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 "This call will obtain the content:\n";
  12. $str = ob_get_contents();
  13. var_dump($str);
  14. ?>
  15. ==DONE==
  16. --EXPECT--
  17. [callback:1]This call will obtain the content:
  18. string(35) "This call will obtain the content:
  19. "
  20. ==DONE==