Functions and the OR operator
<p>Is there in PHP a shorthand for:</p>

<pre><code>function a() {...}
function b() {...}

$c = a();
$c = ($c) ? $c : b();
</code></pre>

<p>In javascript you can simply do:</p>

<pre><code>$c = a() || b();
</code></pre>

<p>but in PHP, if you do this, <code>$c</code> will be a <code>boolean</code> (which is normal, but I want to know if there exists another shorthand which does what I want).</p>

<p><strong>UPDATE</strong><br>
Thank you guys for all the answers.</p>

<p>The shortest way to do it seems to be:</p>

<pre><code>$c = a() ?: b();
</code></pre>

<p>I personally also like:</p>

<pre><code>$c = a() or $c = b();
</code></pre>

<p>for the good readability.</p>
