Throwing an Exception : throw « Statement « PHP






Throwing an Exception

 
<?php
     class ThrowExample {
          public function makeError() {
               throw new Exception("This is an example Exception");
          }
     }
     $inst = new ThrowExample();
     $inst->makeError();
?>
  
  








Related examples in the same category