array_search is using == to compare values during search
FORM PHP DOC
If the third parameter strict is set to TRUE then the array_search() function will search for identical elements in the haystack. This means it will also check the types of the needle in the haystack, and objects must be the same instance.
Becasue the first element is 0 the string was converted to 0 during search
Simple Test
var_dump("sharp" == 0); //true
var_dump("sharp" === 0); //false
Solution use strict option to search identical values
$testsharp = array_search("sharp", $testcopy,true);
^---- Strict Option
var_dump($testsharp);
Output
10