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