spl_autoload_006.phpt 569 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. SPL: spl_autoload() with static methods
  3. --INI--
  4. include_path=.
  5. --FILE--
  6. <?php
  7. class MyAutoLoader {
  8. static function autoLoad($className) {
  9. echo __METHOD__ . "($className)\n";
  10. }
  11. }
  12. spl_autoload_register('MyAutoLoader::autoLoad');
  13. var_dump(spl_autoload_functions());
  14. // check
  15. var_dump(class_exists("TestClass", true));
  16. ?>
  17. ===DONE===
  18. <?php exit(0); ?>
  19. --EXPECTF--
  20. array(1) {
  21. [0]=>
  22. array(2) {
  23. [0]=>
  24. string(12) "MyAutoLoader"
  25. [1]=>
  26. string(8) "autoLoad"
  27. }
  28. }
  29. MyAutoLoader::autoLoad(TestClass)
  30. bool(false)
  31. ===DONE===