<html>
<! TryCatchBySubclass.php                                     >
<! Chapter 9, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates mapping a runtime error to a      >
<! runtime exception, and uses a object type hint to catch a  >
<! user-defined exception.                                    >
<head>
<title>
  Chapter 9 : TryCatchBySubclass.php
</title>
</head>
<body>
<?php
  // Declare an Exception subclass file name.
  $override = "MyException.inc";

  // Declare a non-existant file name.
  $file = "User.inc";

  // Raise an error on a non-existent resource and re-throw an exception.
  try
  {
    if (@!include_once($override))
      throw new MyException("include_once($file) not found.",1,"Override");

    if (@!include_once($file))
      throw new Exception("include_once($file) not found.",1);
  }
  catch (MyException $e) {}
?>
</body>
</html>
