AlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world 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 🐢🇮🇱🇺🇦@lemmy.world to Programmer Humor@lemmy.ml · edit-21 year agomessage-square117fedilink
minus-squareAlmightySnoo 🐢🇮🇱🇺🇦@lemmy.worldOPlinkfedilinkarrow-up11·1 year agohttp://phpsadness.com/sad/30
minus-squaredot20@lemmy.worldlinkfedilinkarrow-up17·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-up2·1 year ago@AlmightySnoo @dot20 hooooo 🤯!! Thank you for the solution! 🤓
minus-squarefubo@lemmy.worldlinkfedilinkarrow-up9·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-squareproflovski@lemmy.worldlinkfedilinkarrow-up1·1 year agoI would expect this from Javascript :S
minus-squarefubo@lemmy.worldlinkfedilinkarrow-up2·1 year agoZZT came out in 1991. JavaScript didn’t exist for at least four years after that.
Wat.
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.