DEV Community

[Comment from a deleted post]
Collapse
 
vasilvestre profile image
Valentin Silvestre

Stop liking my comment !
It's false, it's not a Null coalescing.

Ruby :
a || = b

PHP equivalent :
$a = $a != null ? $a : $b;

Or in "pseudocode" :
If 'a' is not null
'a' is equal to 'a' (itself)
else
'a' is equal to 'b'