Created
August 10, 2014 18:21
-
-
Save datamafia/389b0fab8a49275345b0 to your computer and use it in GitHub Desktop.
PHP order of Operations Check with Ternary
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
// Supports a post as an example | |
$a = true; | |
// double aka nested ternary | |
echo isset($a)?'Outter':isset($a)?'Inner':'Else'; | |
// result "Inner" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment