Another tricky solution (compatible with pre-5.3):
$var = current(array_filter(array($value, $default, $default2)));
But it is really advisable if you have several possible values โโor default values. (Actually, it does not save typing, and not a compact alternative to syntax, just avoids mentioning $value
twice.)
mario source share