PHP - Unexpected behaviour using == (equal) and === (identical)
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1117967/what-does-mean">What does “===” mean?</a>  </p>
</blockquote>



<p>I had the following in my code:</p>

<pre><code>$mixed = array();
$mixed[0] = "It's a zero!";
$mixed['word'] = "It's a word!";   

foreach ($mixed as $key =&gt; $value) {
  if ($key == 'word') {             
    echo $value.'&lt;br /&gt;';
  } 
}
</code></pre>

<p>The above would for some reason print both "It's a zero!" and "It's a word!". I was expecting it to print only "It's a word!". Why is that?? I feel like I am missing something important. When I was using <code>===</code> in the if statement, it worked as expected, in other words it printed only "It's a word!". I know there's a difference between the equal and identical operators, but the first example is not equal is it?</p>
