This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:dev:all:psr:psr-2 [26.05.2015 20:23] – finished translation mrbaseman | en:dev:all:psr:psr-2 [31.03.2017 06:59] (current) – [try, catch] Manuela v.d.Decken | ||
|---|---|---|---|
| Line 305: | Line 305: | ||
| - | ==== try, catch ==== | + | ==== try, catch, finally |
| A **try catch** block looks like the following. Note the placement of parentheses, | A **try catch** block looks like the following. Note the placement of parentheses, | ||
| <PHP> | <PHP> | ||
| Line 314: | Line 314: | ||
| } catch (OtherExceptionType $e) { | } catch (OtherExceptionType $e) { | ||
| // catch body | // catch body | ||
| + | } finally { | ||
| + | // finally body | ||
| } | } | ||
| </ | </ | ||