You're viewing a single thread.
View all comments
23
comments
I don't understand this. Small brained users rise up
12 0 ReplyOn the left you have Elvis Presley, while on the right there's the so-called Elvis operator
7 0 Replybeen programming since 2008. the fuck is an elvis operator?
10 0 ReplyBeen programming since the 80s, ditto.
5 0 ReplyTernary if?then:else
3 0 Replygotacha. i've only ever heard them called ternaries. maybe i'm old. maybe i'm too young. definitely one of the two
3 0 ReplyIt 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
6 0 Reply
You've viewed 23 comments.
Scroll to top