PHP Classes

File: Raw-PHP/ExceptionHandling.php

Recommend this page to a friend!
  Classes of Kabir Hossain   Learn PHP   Raw-PHP/ExceptionHandling.php   Download  
File: Raw-PHP/ExceptionHandling.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Learn PHP
Examples of PHP features using OOP or global code
Author: By
Last change:
Date: 3 days ago
Size: 399 bytes
 

 

Contents

Class file image Download
<?php
/*
    try: try lead the exception occurring code
    catch: catch section executed if try block code occurred an exception
    throw: throw used for manually triggering for an exception.
*/

try {
    print
"this is our try block n";
   
//throw new Exception();
} catch (Exception $e) {
    print
"something went wrong, caught yah!";
} finally {
    print
"this part is always executed n";
}