title: Best way to give a variable a default value (simulate Perl ||, ||= )
body: <p>I love doing this sort of thing in Perl: <code>$foo = $bar || $baz</code> to assign <code>$baz</code> to <code>$foo</code> if <code>$bar</code> is empty or undefined. You also have <code>$foo ||= $bletch</code> which will only assign <code>$bletch</code> to <code>$foo</code> if <code>$foo</code> is not defined or empty.</p>
  
  <p>The ternary operator in this situation is tedious and tiresome. Surely there's a simple, elegant method available in PHP?</p>
  
  <p>Or is the only answer a custom function that uses isset()? </p>