summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug73896.phpt
blob: 08d8f1e6c8c7bc38ac567471f61f88fd2e41eab9 (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
31
32
33
34
35
36
37
38
--TEST--
Bug #73896 (spl_autoload() crashes when calls magic _call())
--FILE--
<?php
class Registrator {
    public static function call($callable, array  $args) {
        return call_user_func_array($callable, [$args]);
    }
}

class teLoader {
    public function __construct() {
        Registrator::call('spl_autoload_register', [$this, 'autoload']);
    }

    public function __call($method, $args) {
        $this->doSomething();
    }

    protected function autoload($class) {
    	die("Protected autoload() called!\n");
    }

    public function doSomething() {
        throw new teException();
    }
}

$teLoader = new teLoader();

try {
	new teChild();
} catch (Throwable $e) {
	echo "Exception: ", $e->getMessage() , "\n";
}
?>
--EXPECT--
Exception: Class 'teException' not found