summaryrefslogtreecommitdiff
path: root/Zend/tests/try/catch_finally_001.phpt
blob: 0c3f597a0a5a2692dd3fe7a29fa103c786bd1d7e (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
--TEST--
Try catch finally (basic test)
--FILE--
<?php
function foo ($throw = FALSE) {
   try {
     echo "try\n";
     if ($throw) {
        throw new Exception("ex");
     }
   } catch (Exception $e) {
     echo "catch\n"; 
   } finally {
     echo "finally\n";
   }

   echo "end\n";
}

foo();
echo "\n";
foo(true);
?>
--EXPECTF--
try
finally
end

try
catch
finally
end