bug69315.phpt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --TEST--
  2. Bug #69315 (disable_functions behaviors inconsistently)
  3. --INI--
  4. disable_functions=strlen,defined,call_user_func,constant,is_string
  5. --FILE--
  6. <?php
  7. var_dump(function_exists("strlen"));
  8. var_dump(is_callable("strlen"));
  9. try {
  10. var_dump(strlen("xxx"));
  11. } catch (Error $e) {
  12. echo $e->getMessage(), "\n";
  13. }
  14. try {
  15. var_dump(defined("PHP_VERSION"));
  16. } catch (Error $e) {
  17. echo $e->getMessage(), "\n";
  18. }
  19. try {
  20. var_dump(constant("PHP_VERSION"));
  21. } catch (Error $e) {
  22. echo $e->getMessage(), "\n";
  23. }
  24. try {
  25. var_dump(call_user_func("strlen"));
  26. } catch (Error $e) {
  27. echo $e->getMessage(), "\n";
  28. }
  29. try {
  30. var_dump(is_string("xxx"));
  31. } catch (Error $e) {
  32. echo $e->getMessage(), "\n";
  33. }
  34. try {
  35. var_dump(is_string());
  36. } catch (Error $e) {
  37. echo $e->getMessage(), "\n";
  38. }
  39. ?>
  40. --EXPECT--
  41. bool(false)
  42. bool(false)
  43. Call to undefined function strlen()
  44. Call to undefined function defined()
  45. Call to undefined function constant()
  46. Call to undefined function call_user_func()
  47. Call to undefined function is_string()
  48. Call to undefined function is_string()