Created
July 3, 2015 11:09
-
-
Save Odalrick/9e6f0f4c41adfc673b89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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