catch_finally_005.phpt 326 B

123456789101112131415161718192021
  1. --TEST--
  2. Try catch finally (with multi-returns and exception)
  3. --FILE--
  4. <?php
  5. function foo ($a) {
  6. try {
  7. throw new Exception("ex");
  8. } catch (PdoException $e) {
  9. die("error");
  10. } catch (Exception $e) {
  11. return 2;
  12. } finally {
  13. return 3;
  14. }
  15. return 1;
  16. }
  17. var_dump(foo("para"));
  18. ?>
  19. --EXPECT--
  20. int(3)