Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added the finally block. #321

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion accepted/PSR-2-coding-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ foreach ($iterable as $key => $value) {
}
```

### 5.6. `try`, `catch`
### 5.6. `try`, `catch`, `finaly`

A `try catch` block looks like the following. Note the placement of
parentheses, spaces, and braces.
Expand All @@ -490,6 +490,20 @@ try {
// catch body
}
```
And when you use the `finally` block it's will be like the following.

```php
<?php
try {
// try body
} catch (FirstExceptionType $e) {
// catch body
} catch (OtherExceptionType $e) {
// catch body
} finally {
// finally body
}
```

6. Closures
-----------
Expand Down