Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo phpversion()."\n";
- class FooException extends Exception
- {
- }
- class Something
- {
- public function DoSomething()
- {
- throw new FooException();
- }
- }
- try
- {
- $o = new Something;
- $o->DoSomething();
- }
- catch (FooException $ex)
- {
- echo "FooException: ".get_class($ex);
- }
- catch (Exception $ex)
- {
- echo "Excetpion: ".get_class($ex);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement