Created
October 29, 2013 20:00
-
-
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
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 | |
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