Sleepzy@feddit.it to Programmer Humor@lemmy.ml · 2 years agoElvisfeddit.itexternal-linkmessage-square31linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkElvisfeddit.itSleepzy@feddit.it to Programmer Humor@lemmy.ml · 2 years agomessage-square31linkfedilink
minus-squareQuazarOmega@lemy.lollinkfedilinkarrow-up0·2 years agoIt specifically refers to this shorthand ?: that works like this: $value = $thing_that_could_be_truthy ?: 'fallback value'; # same as $value = $thing_that_could_be_truthy ? $thing_that_could_be_truthy : 'fallback value'; The condition is also the value if it is truthy
It specifically refers to this shorthand
?:that works like this:$value = $thing_that_could_be_truthy ?: 'fallback value'; # same as $value = $thing_that_could_be_truthy ? $thing_that_could_be_truthy : 'fallback value';The condition is also the value if it is truthy