summaryrefslogtreecommitdiff
path: root/Zend/tests/bug61442.phpt
blob: 3af534fec9ad0fb0d16b89fe9c42c43869d5de73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--TEST--
Bug #61442 (exception threw in __autoload can not be catched)
--FILE--
<?php
function __autoload($name) {
    throw new Exception("Unable to load $name");
}

try {
    $obj = new NonLoadableClass();
} catch (Exception $e) {
    var_dump($e->getMessage());
}

try {
    $obj = NonLoadableClass::a();
} catch (Exception $e) {
    var_dump($e->getMessage());
}

try {
    $obj = NonLoadableClass::UNDEFINED_CONST;
} catch (Exception $e) {
    var_dump($e->getMessage());
}

--EXPECTF--
string(31) "Unable to load NonLoadableClass"
string(31) "Unable to load NonLoadableClass"
string(31) "Unable to load NonLoadableClass"