Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- function md_require($file){
- if(file_exists($file)) {
- require_once($file);
- } else {
- throw(new Exception('File '.$file.' does not exist.'));
- }
- }
- md_require("config.php");
- echo "This is a test file";
- */
- try {
- $error = 'Always throw this error';
- throw new Exception($error);
- // Code following an exception is not executed.
- echo 'Never executed';
- } catch (Exception $e) {
- echo 'Caught exception: ', $e->getMessage(), "\n";
- }
- // Continue execution
- echo 'Hello World';
- ?>
Add Comment
Please, Sign In to add comment