bug63741.phpt 763 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --TEST--
  2. Bug #63741 (Crash when autoloading from spl)
  3. --FILE--
  4. <?php
  5. file_put_contents(__DIR__."/bug63741.tmp.php",
  6. <<<'EOT'
  7. <?php
  8. if (isset($autoloading))
  9. {
  10. class ClassToLoad
  11. {
  12. static function func ()
  13. {
  14. print "OK!\n";
  15. }
  16. }
  17. return;
  18. }
  19. else
  20. {
  21. class autoloader
  22. {
  23. static function autoload($classname)
  24. {
  25. print "autoloading...\n";
  26. $autoloading = true;
  27. include __FILE__;
  28. }
  29. }
  30. spl_autoload_register(["autoloader", "autoload"]);
  31. function start()
  32. {
  33. ClassToLoad::func();
  34. }
  35. start();
  36. }
  37. ?>
  38. EOT
  39. );
  40. include __DIR__."/bug63741.tmp.php";
  41. ?>
  42. --CLEAN--
  43. <?php unlink(__DIR__."/bug63741.tmp.php"); ?>
  44. --EXPECT--
  45. autoloading...
  46. OK!