Consider a topos, i.e. the category $Shv$ of sheaves on a Grothendieck site $T$ with values in abelian groups. The category $Shv$ is symmetric monoidal with $\otimes$, the tensor product in every degree. It has also an internal hom (meaning that it is closed symmetric monoidal). There are two "definitions" of this internal hom in the literature which I can't bring together (it can also be that they are different and I have missed the point). Fix objects $X$ and $Y$ of $Shv$. The first definition of the internal hom is the presheaf
$$
U\mapsto \hom_{Shv}(X|_U, Y|_U)
$$
which turns out to be sheaf. The second one is the sheafification of the presheaf
$$ U\mapsto \hom_{PreShv}(X\times \hom(-,U),Y) $$
Do they coincide? Perhaps I am totally blind so I apologize in either way.
An edit: Perhaps I was too hasty and thoughtless when I formulated the question. So let's look at set-valued sheaves. A third definition is the sheafification of the presheaf $$ U\mapsto \hom_{Sets}(X(U),Y(U)). $$ I do not even see (after playing around with Yoneda's lemma) why this coincides with the "second definition" $U\mapsto \hom_{PreShv}(X\times \hom_{Sets}(-,U),Y)$.