PHP Fatal Error. Does empty() try to alter the results passed into it?
<p>Ran into a strange problem in PHP today and I'm wondering if someone can explain it.  While comparing two arrays I initially tried something like this:</p>

<pre><code>echo empty(array_diff( array('foo','bar') , array('bar','foo') ))
</code></pre>

<p>This results in the following error:</p>

<blockquote>
  <p>Fatal Error: Can't use function return value in write context</p>
</blockquote>

<p>Rewriting this as...</p>

<pre><code>$dif = array_diff( array('foo','bar') , array('bar','foo') );
echo empty($dif);
</code></pre>

<p>...works perfectly.  Empty should just be evaluating the value passed in to it, not writing to it, so what's going wrong here?  Tested in both PHP 5.2.10 and PHP 5.3.2.</p>

<hr>

<p>I've resolved the issue by using <code>!count()</code> instead of <code>empty()</code>, but I'm curious why it doesn't work in the first place.  Is <code>empty()</code> trying to alter the result from <code>array_diff</code>?</p>
