ob_start_basic_005.phpt 578 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. ob_start(): non-static method as static callbacks.
  3. --FILE--
  4. <?php
  5. /*
  6. * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
  7. * Function is implemented in main/output.c
  8. */
  9. Class C {
  10. function h($string) {
  11. return $string;
  12. }
  13. }
  14. function checkAndClean() {
  15. print_r(ob_list_handlers());
  16. while (ob_get_level()>0) {
  17. ob_end_flush();
  18. }
  19. }
  20. var_dump(ob_start('C::h'));
  21. checkAndClean();
  22. ?>
  23. --EXPECTF--
  24. Warning: ob_start(): non-static method C::h() should not be called statically in %s on line 20
  25. bool(true)
  26. Array
  27. (
  28. [0] => C::h
  29. )