I think it would have a great use case if you're building a lot of options in a function or class method.
so instead of this:
$key='default value';if(\array_key_exists('key',$options)){$key=$options['key'];}# But a bunch more ...
But instead we could do a bunch of these:
$key=$options['key']??'default value';
Also, I'd like to say sorry. I don't think we should always be doing the regular if then else statement. As you said, it's case-by-case. Developers should just learn the language instead.
I think everyone should understand how the ternary operators work. Their symbols are similar to that of && or ||.
Must've missed it, because I didn't see any examples of the 'Evlis' operators or null coalescing.
Anyways, thank you for the great article. w^
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think it would have a great use case if you're building a lot of options in a function or class method.
so instead of this:
But instead we could do a bunch of these:
Also, I'd like to say sorry. I don't think we should always be doing the regular if then else statement. As you said, it's case-by-case. Developers should just learn the language instead.
I think everyone should understand how the ternary operators work. Their symbols are similar to that of
&&
or||
.Must've missed it, because I didn't see any examples of the 'Evlis' operators or null coalescing.
Anyways, thank you for the great article. w^