Según la documentación oficial en http://php.net/manual/en/function.array-search.php:
Advertencia Esta función puede devolver FALSE, pero también puede devolver un valor no booleano que será evaluado FALSE. Lea la sección en Booleanos para obtener más información. Use el operador === para probar el valor de retorno de esta función.
ver este ejemplo:
$foundKey = array_search(12345, $myArray);
if(!isset($foundKey)){
// If $myArray is null, then $foundKey will be null too.
// Do something when both $myArray and $foundKey are null.
} elseif ($foundKey===false) {
// $myArray is not null, but 12345 was not found in the $myArray array.
}else{
// 12345 was found in the $myArray array.
}
Es más rápido para probarlo y ver el resultado de pedir a él. –
compruebe el resultado is_int() viendo como devuelve una clave. – PolarTheDog