function_exists_basic.phpt 866 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. function_exists function : basic functionality
  3. --FILE--
  4. <?php
  5. /*
  6. * proto bool function_exists(string function_name)
  7. * Function is implemented in Zend/zend_builtin_functions.c
  8. */
  9. echo "*** Testing function_exists() : basic functionality ***\n";
  10. echo "Internal function: ";
  11. var_dump(function_exists('function_exists'));
  12. echo "User defined function: ";
  13. function f() {}
  14. var_dump(function_exists('f'));
  15. echo "Case sensitivity: ";
  16. var_dump(function_exists('F'));
  17. echo "Non existent function: ";
  18. var_dump(function_exists('g'));
  19. echo "Method: ";
  20. Class C {
  21. static function f() {}
  22. }
  23. var_dump(function_exists('C::f'));
  24. ?>
  25. ===Done===
  26. --EXPECT--
  27. *** Testing function_exists() : basic functionality ***
  28. Internal function: bool(true)
  29. User defined function: bool(true)
  30. Case sensitivity: bool(true)
  31. Non existent function: bool(false)
  32. Method: bool(false)
  33. ===Done===