AlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world to Programmer Humor@lemmy.ml · edit-21 year agoand people wonder why we say PHP is a memelemmy.worldimagemessage-square117fedilinkarrow-up1370arrow-down134
arrow-up1336arrow-down1imageand people wonder why we say PHP is a memelemmy.worldAlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world to Programmer Humor@lemmy.ml · edit-21 year agomessage-square117fedilink
minus-squaredot20@lemmy.worldlinkfedilinkarrow-up16·1 year agoAh, I understand now. The expression is evaluated like this: $a == 1 ? "one" : $a == 2 ? "two" : $a == 3 ? "three" : "other" $a == 2 ? "two" : $a == 3 ? "three" : "other" "two" ? "three" : "other" "three"
minus-square🌈 Lascapi@mastodon.zaclys.comlinkfedilinkarrow-up2arrow-down1·1 year ago@AlmightySnoo @dot20 hooooo 🤯!! Thank you for the solution! 🤓
Ah, I understand now. The expression is evaluated like this:
$a == 1 ? "one" : $a == 2 ? "two" : $a == 3 ? "three" : "other"
$a == 2 ? "two" : $a == 3 ? "three" : "other"
"two" ? "three" : "other"
"three"
@AlmightySnoo @dot20 hooooo 🤯!! Thank you for the solution! 🤓