bug49908.phpt 534 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #49908 (throwing exception in __autoload crashes when interface is not defined)
  3. --FILE--
  4. <?php
  5. function __autoload($className) {
  6. var_dump($className);
  7. if ($className == 'Foo') {
  8. class Foo implements Bar {};
  9. } else {
  10. throw new Exception($className);
  11. }
  12. }
  13. new Foo;
  14. ?>
  15. --EXPECTF--
  16. %unicode|string%(3) "Foo"
  17. %unicode|string%(3) "Bar"
  18. Fatal error: Uncaught exception 'Exception' with message 'Bar' in %s:%d
  19. Stack trace:
  20. #0 %s(7): __autoload('Bar')
  21. #1 %s(13): __autoload('Foo')
  22. #2 {main}
  23. thrown in %s on line %d