Sleepzy ( Sleepzy@feddit.it ) to Programmer Humor@lemmy.ml · 2 years agoElvisfeddit.itimagemessage-square15linkfedilinkarrow-up190
arrow-up190imageElvisfeddit.itSleepzy ( Sleepzy@feddit.it ) to Programmer Humor@lemmy.ml · 2 years agomessage-square15linkfedilink
minus-squareQuazarOmega ( QuazarOmega@lemy.lol ) linkfedilinkarrow-up8·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