xref: /PHP-5.3/Zend/tests/bug61442.phpt (revision fd0b3ea6)
1--TEST--
2Bug #61442 (exception threw in __autoload can not be catched)
3--FILE--
4<?php
5function __autoload($name) {
6    throw new Exception("Unable to load $name");
7}
8
9try {
10    $obj = new NonLoadableClass();
11} catch (Exception $e) {
12    var_dump($e->getMessage());
13}
14
15try {
16    $obj = NonLoadableClass::a();
17} catch (Exception $e) {
18    var_dump($e->getMessage());
19}
20
21try {
22    $obj = NonLoadableClass::UNDEFINED_CONST;
23} catch (Exception $e) {
24    var_dump($e->getMessage());
25}
26
27--EXPECTF--
28string(31) "Unable to load NonLoadableClass"
29string(31) "Unable to load NonLoadableClass"
30string(31) "Unable to load NonLoadableClass"
31