Pick first non-empty value from a list in PHP
<p>Assuming <code>$a</code>, <code>$b</code>, <code>$c</code>, <code>$d</code>, <code>$e</code> be some random unknown values. I'd like to pick one value from them which is not empty with priority in that order.</p>

<p>To be brief, I want to achieve the same result as in javascript <code>return $a || $b || $c || $d || $e || 0;</code> does.</p>

<p>Currently, in PHP we use (parenthesis are just for readability): </p>

<p><code>return $a ? $a : ($b ? $b : ($c ? $c : ($d ? $d : ($e ? $e : 0))));</code></p>

<p>Or since PHP 5.3</p>

<p><code>return $a ?: $b ?: $c ?: $d ?: $e ?: 0;</code></p>

<p>I can see the 5.3 syntax is lighter and almost similar to that of JavaScript. But I wonder if there is something more elegant available in PHP.</p>

<p>The other question marked as duplicate to this  asks for a solution to do this. But here I am asking for improvement in case there is something available in PHP natively. This is to ensure we use best possible solution for the said problem.</p>