Created
December 20, 2011 19:31
-
-
Save fzaninotto/1502867 to your computer and use it in GitHub Desktop.
Catch Interface
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 | |
interface Bar {} | |
class Foo extends Exception implements Bar {} | |
try | |
{ | |
throw new Foo(); | |
} catch (Bar $e) { | |
echo "good!\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wonder if you can do this with Traits in PHP 5.4.