xref: /PHP-8.0/Zend/tests/bug65254.phpt (revision 7aacc705)
1--TEST--
2Bug #65254 (Exception not catchable when exception thrown in autoload with a namespace)
3--FILE--
4<?php
5spl_autoload_register(function ($class) {
6    eval("namespace ns_test; class test {}");
7
8    throw new \Exception('abcd');
9});
10
11try
12{
13    \ns_test\test::go();
14}
15catch (Exception $e)
16{
17    echo 'caught';
18}
19?>
20--EXPECT--
21caught
22