ScotlandPHP 2019


Please answer this simple SPAM challenge: max(eight, seven)?
(Example: nine)

The Note You're Voting On

jenshausdorf at gmail dot com
1 year ago
Please don't do something like this:

try {
// experimental stuff to check whether something works
} catch(\Throwable $e) {
} finally {

Well, it is allowed syntax, it is bad practice, because once it hits the exception block, finally won't be called(because it exits the scope). Finally was invented to prevent duplicated code after one operation, regardless whether it was successful(for example closing the connection to a server). This way, you don't have any duplicated code. So you don't need to use this structure.

<< Back to user notes page

To Top