Search the Community
Showing results for tags 'exceptions'.
-
Hi All, I have touched upon exceptions earlier. However I am still not sure if I am handling them correctly. try { ... ... ... }catch(Exception $e){ if($prod === true) // In production mode { header("Location: exceptions/errors.php")...
- 19 replies
-
- exceptions
- errors
-
(and 1 more)
Tagged with:
-
Hi all ! I have been using this snippet below to study exceptions: <?php mysqli_report(MYSQLI_REPORT_STRICT); try { $connection = new mysqli('localhos', 'root', '', 'test') ; } catch (Exception $e ) { echo "Server Error"; } ?> If, as in the snippet, I misspell the localhost, I am...
-
Not strictly php, but this seems a reasonable place to ask If documenting a routine ( which may or not directly throw an exception ), but whichh calls another one which definitely DOES, how would one write the @throws lines in the procedure header? 1. Ignore the exceptions thrown by called...
-
I'm trying to figure out what the point in using try exceptions is. I recently learned about then and up until now, I've just used if statements. For example, lets say I wanna save an uploaded file to the server. Heres the code I use: if (move_uploaded_file($_FILES["file"]["tmp_name"], "uploa...