AlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world to Programmer Humor@lemmy.ml · edit-21 year agoand people wonder why we say PHP is a memelemmy.worldimagemessage-square117fedilinkarrow-up1382arrow-down138
arrow-up1344arrow-down1imageand people wonder why we say PHP is a memelemmy.worldAlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world to Programmer Humor@lemmy.ml · edit-21 year agomessage-square117fedilink
minus-squareLemmypylinkfedilinkarrow-up20·1 year agoFinally got it… $a == 1 ? "one" : ( ( $a == 2 ? "two" : $a == 3 ) ? "three" : "other" )
minus-squareWorthstream@lemmy.onelinkfedilinkarrow-up1·1 year agoYep, any non empty string is truthy.
Finally got it…
$a == 1 ? "one" : ( ( $a == 2 ? "two" : $a == 3 ) ? "three" : "other" )
because “two” is a truthy value?
Yep, any non empty string is truthy.