Skip to content

Instantly share code, notes, and snippets.

@firegate666
Created October 29, 2013 20:00
Show Gist options
  • Save firegate666/7221533 to your computer and use it in GitHub Desktop.
Save firegate666/7221533 to your computer and use it in GitHub Desktop.
Funny behaviour where you can override the return value of a method in finally
<?php
function blabla() {
try {
echo "try";
return 1;
} catch (Exception $e) {
echo "catched";
return 4;
} finally {
print "finally";
return 3;
}
return 2;
}
echo blabla(); // tryfinally3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment