I thought I'd seen this before, but I'm not finding it anywhere.
If I have a variable and want to assign it a new value if a condition is true, but otherwise leave the variable alone, is there a way to do this without repeating the variable/original value?
The "long ways" would be:
if($condition == TRUE) {
$og_value = "New Value";
}
Or:
$og_value = ($condition == TRUE) ? "New Value" : $og_value;
But I seem to remember there is a trick, either built into assignment operators or using bitwise operators to only set $og_value if $condition is true, otherwise it short circuits and leaves $og_value as it was before the assignment/comparison.