how to shorten the logic to assign new or default value in php
<p>I have following code in php:</p>

<pre><code>$mode = $this-&gt;input-&gt;get('mode'); // may return string or boolean false
if(!$mode)
    $mode = 'default';
</code></pre>

<p>how can shorten this code to one line with fastest execution</p>

<p>Is this perfect one:</p>

<pre><code>$mode = ($mode=$this-&gt;input-&gt;get('mode'))?$mode:'default';
</code></pre>
