From 9d2719e2e45df830dfa1559cac116993100165d7 Mon Sep 17 00:00:00 2001 From: Gabriel Hoverman Date: Wed, 20 Feb 2019 23:52:08 -0500 Subject: [PATCH] Added PHP Try Catch to Guide. (#33840) * Added PHP Try Catch to Guide. * fix: change tru to try --- guide/english/php/try-catch/index.md | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 guide/english/php/try-catch/index.md diff --git a/guide/english/php/try-catch/index.md b/guide/english/php/try-catch/index.md new file mode 100644 index 0000000000..5cc917777f --- /dev/null +++ b/guide/english/php/try-catch/index.md @@ -0,0 +1,56 @@ +--- +title: try catch +--- + +## Try Catch in PHP + +When working in PHP, it is considered good practice to utilize error handling within your code. This allows you to return error messages, rather than crashing returning nothing, or worse, crashing your application. There are many ways to utilize Exceptions in PHP, but a common one is the Try Catch block. + + +## Syntax + +The syntax for a try catch starts with a try statement, followed by code to be executed, which is then followed by a catch statement with some form of error handling. + +``` +