Quickie: a = b || c
This little post can be handy specially for full-stack devs, who use JS and PHP. PHP being a requirement here.
Do you know what happens when you assign OR-logical expression to a variable? Specifically in PHP, as it acts differently from other languages.
Python:
result = "hello" || "world"
print(result)
JavaScript:
result = 'hello' || 'world';
console.log(result);
In python and javascript the result is "hello".
PHP:
$result = 'hello' || 'world';
echo $result;
But in PHP you get true.
Don't forget about this when you switch contexts or rewrite code to/from PHP.