Skip to content

Instantly share code, notes, and snippets.

@Odalrick
Created July 3, 2015 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Odalrick/9e6f0f4c41adfc673b89 to your computer and use it in GitHub Desktop.
Save Odalrick/9e6f0f4c41adfc673b89 to your computer and use it in GitHub Desktop.
<?php
namespace ExceptionTest;
interface CatchableException {}
class InterfacedException extends \Exception implements CatchableException {}
function testCatchingException(){
try {
throw new InterfacedException('This works well.');
} catch (CatchableException $e){
echo $e->getMessage();
}
}
testCatchingException();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment