AlmightySnoo 🐢🇮🇱🇺🇦 to Programmer Humor@lemmy.ml • edit-21 year agoand people wonder why we say PHP is a memelemmy.worldimagemessage-square117fedilinkarrow-up1375
arrow-up1375imageand people wonder why we say PHP is a memelemmy.worldAlmightySnoo 🐢🇮🇱🇺🇦 to Programmer Humor@lemmy.ml • edit-21 year agomessage-square117fedilink
minus-square@dot20@lemmy.worldlinkfedilink17•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🌈 Lascapilinkfedilink2•1 year ago@AlmightySnoo @dot20 hooooo 🤯!! Thank you for the solution! 🤓
minus-square@fubo@lemmy.worldlinkfedilink9•edit-21 year agoIf you think PHP is weird, go look up ZZT-OOP, the scripting language from Tim Sweeney’s first game. (No, a scripting language for game characters doesn’t need integers. If you need to count, you can do that by moving blocks around on the game board.)
minus-square@fubo@lemmy.worldlinkfedilink2•1 year agoZZT came out in 1991. JavaScript didn’t exist for at least four years after that.
http://phpsadness.com/sad/30
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! 🤓
If you think PHP is weird, go look up ZZT-OOP, the scripting language from Tim Sweeney’s first game.
(No, a scripting language for game characters doesn’t need integers. If you need to count, you can do that by moving blocks around on the game board.)
I would expect this from Javascript :S
ZZT came out in 1991. JavaScript didn’t exist for at least four years after that.