ob_start_error_002.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --TEST--
  2. Test wrong number of arguments and wrong arg types for ob_start()
  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. static function f($str) {
  11. return $str;
  12. }
  13. }
  14. var_dump(ob_start(array("nonExistent","f")));
  15. var_dump(ob_start(array("C","nonExistent")));
  16. var_dump(ob_start("C::no"));
  17. var_dump(ob_start("no"));
  18. echo "done"
  19. ?>
  20. --EXPECTF--
  21. Warning: ob_start(): class 'nonExistent' not found in %s on line 13
  22. Notice: ob_start(): failed to create buffer in %s on line 13
  23. bool(false)
  24. Warning: ob_start(): class 'C' does not have a method 'nonExistent' in %s on line 14
  25. Notice: ob_start(): failed to create buffer in %s on line 14
  26. bool(false)
  27. Warning: ob_start(): class 'C' does not have a method 'no' in %s on line 15
  28. Notice: ob_start(): failed to create buffer in %s on line 15
  29. bool(false)
  30. Warning: ob_start(): function 'no' not found or invalid function name in %s on line 16
  31. Notice: ob_start(): failed to create buffer in %s on line 16
  32. bool(false)
  33. done