xref: /PHP-7.2/tests/classes/autoload_008.phpt (revision 7af945e2)
1--TEST--
2Ensure catch blocks for unknown exception types do not trigger autoload.
3--FILE--
4<?php
5spl_autoload_register(function ($name) {
6  echo "In autoload: ";
7  var_dump($name);
8});
9
10function f()
11{
12  throw new Exception();
13}
14try {
15  f();
16}
17catch (UndefC $u) {
18  echo "In UndefClass catch block.\n";
19}
20catch (Exception $e) {
21  echo "In Exception catch block. Autoload should not have been triggered.\n";
22}
23?>
24--EXPECTF--
25In Exception catch block. Autoload should not have been triggered.
26