xref: /php-src/Zend/tests/try/catch_novar_1.phpt (revision 7aacc705)
1--TEST--
2catch without capturing a variable
3--FILE--
4<?php
5
6try {
7    throw new Exception();
8} catch (Exception) {
9    echo "Exception\n";
10}
11
12try {
13    throw new Exception();
14} catch (Exception) {
15    echo "Exception\n";
16} catch (Error) {
17    echo "FAIL\n";
18}
19
20try {
21    throw new Exception();
22} catch (Exception|Error) {
23    echo "Exception\n";
24} catch (Throwable) {
25    echo "FAIL\n";
26}
27
28?>
29--EXPECT--
30Exception
31Exception
32Exception
33