 <p>Welcome to the wonderful world of loose typing. In php, array_search defaults to nonstrict comparisons ("=="), but you can add a third parameter to force strict ("==="). You almost always want strict, though there are times when nonstrict is the correct operation.</p> <p>check out the following:</p> <pre><code>$allcraftatts = array(0, 0, 0, 0, 0, 0, "Sharp Stone", "Sharp Stones", "stone", new stdClass(), "sharp", "hard", 0, 0, 0, 0, 0,0 ,0); $testcopy=$allcraftatts; $testsharp=array_search("sharp", $testcopy); $testsharpStrict=array_search("sharp", $testcopy, true); print_r(get_defined_vars()); if(0 == "sharp"){ echo "true for == \n"; }else{ echo "false == \n"; } if(0 === "sharp"){ echo "true for === \n"; }else{ echo "false === \n"; } </code></pre> <p>and the output:</p> <pre><code>[testcopy] =&gt; Array ( [0] =&gt; 0 [1] =&gt; 0 [2] =&gt; 0 [3] =&gt; 0 [4] =&gt; 0 [5] =&gt; 0 [6] =&gt; Sharp Stone [7] =&gt; Sharp Stones [8] =&gt; stone [9] =&gt; stdClass Object ( ) [10] =&gt; sharp [11] =&gt; hard [12] =&gt; 0 [13] =&gt; 0 [14] =&gt; 0 [15] =&gt; 0 [16] =&gt; 0 [17] =&gt; 0 [18] =&gt; 0 ) [testsharp] =&gt; 0 [testsharpStrict] =&gt; 10 ) true for == false === </code></pre>