Skip to content

Instantly share code, notes, and snippets.

@kellegous
Last active September 10, 2015 23:50
Show Gist options
  • Select an option

  • Save kellegous/7315442a1f4bfebbc265 to your computer and use it in GitHub Desktop.

Select an option

Save kellegous/7315442a1f4bfebbc265 to your computer and use it in GitHub Desktop.
<?php
function foo() {
try {
throw new Exception("ex1");
} finally {
try {
throw new Exception("ex2");
} catch (Exception $e) {
printf("caught in finally message=%s\n", $e->getMessage());
}
echo "end of finally.\n";
}
}
try {
foo();
echo "this should not get executed.\n";
} catch (Exception $e) {
printf("caught from call to foo() messsage=%s\n", $e->getMessage());
}
echo "all done.\n";
caught in finally message=ex2
end of finally.
this should not get executed.
all done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment