Last active
August 29, 2015 14:00
-
-
Save fmtarif/11380420 to your computer and use it in GitHub Desktop.
#php - useful short circuits
This file contains hidden or 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 | |
mysql_connect(localhost,$user,$password) or die( “Unable to connect”); | |
/* | |
if ($from && $to && $msg) { | |
sendMail(); | |
} | |
*/ | |
$from && $to && $msg && sendMail(); | |
//short circuit | |
//TRUE && "this expression will be executed" | |
//FALSE || "this expression will be executed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment