autoload_013.phpt 432 B

12345678910111213141516171819202122
  1. --TEST--
  2. Ensure the ReflectionClass constructor triggers autoload.
  3. --SKIPIF--
  4. <?php extension_loaded('reflection') or die('skip'); ?>
  5. --FILE--
  6. <?php
  7. function __autoload($name)
  8. {
  9. echo "In autoload: ";
  10. var_dump($name);
  11. }
  12. try {
  13. new ReflectionClass("UndefC");
  14. }
  15. catch (ReflectionException $e) {
  16. echo $e->getMessage();
  17. }
  18. ?>
  19. --EXPECTF--
  20. In autoload: string(6) "UndefC"
  21. Class UndefC does not exist