Created
October 8, 2010 19:42
-
-
Save dbergey/617401 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 | |
function a() { | |
echo "Called A.\n"; | |
return false; | |
} | |
function b() { | |
echo "Called B.\n"; | |
return true; | |
} | |
a() && b(); | |
?> |
What it DOESN'T do is return the value of the truey expression when using ||.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
b() is never called because a() returned false. Good to know that PHP lazily evaluates.