xref: /PHP-7.4/Zend/tests/bug65254.phpt (revision 162aa1a5)
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--EXPECT--
20caught
21