PHP and ?? operator
<p>Like some people know, C# has very useful <code>??</code> operator which evaluates and returns expression on the right if expression on the left is null. It's very useful for providing default values, for example:</p>

<pre><code>int spaces = readSetting("spaces") ?? 5;
</code></pre>

<p>If <code>readSetting</code> couldn't find <code>"spaces"</code> and returns null, variable <code>spaces</code> would hold default value of <code>5</code>.</p>

<p>You could do almost the same in JavaScript and Ruby with <code>||</code> operator, as in</p>

<pre><code>var spaces = readSetting("spaces") || 5;
</code></pre>

<p>although you couldn't have <code>0</code> as value of <code>spaces</code> in JavaScript in this case and <code>false</code> in both Ruby and JavaScript.</p>

<p>PHP has <code>or</code> operator and although it doesn't work as <code>||</code> in a sense that it doesn't return expression from the right, it still could be useful here:</p>

<pre><code>$spaces = readSetting('spaces') or $spaces = 5;
</code></pre>

<p>with the note that <code>""</code> and <code>"0"</code> are also treated like <code>false</code> in PHP in addition to <code>false, 0</code> and <code>null</code> in most languages.</p>

<p>The question is, should I use the construction from above? Does it have side effects apart from treating large class of characters as false? And is there better construction that is usually used and recommended by PHP community this task?</p>
