A typical formal statement of the Axiom of Replacement is (leaving out some technical details about extra "parameter variables" that $\phi$ sometimes takes.)

$[\forall x,y,z\ (\phi(x,y) \wedge \phi(x,z) \implies y=z)] \implies [\forall X \exists Y \forall y\ (y \in Y \iff (\exists x \in X)\ \phi(x,y))]$.

The hypothesis "$\forall x,y,z\ (\phi(x,y) \wedge \phi(x,z) \implies y=z)$" states that the relation $\phi$ defines a function: to each $x$ that is related with some $y$, it is related with only one $y$. One tempting revision to express that hypothesis more succinctly is as $\forall x \exists ! y\ \phi(x,y)$. However, this implies something stronger about $\phi$, namely, that it relates *every* $x$ to some (unique) $y$, whereas the first formulation allows that for some $x$ and all $y$, $\phi(x,y)$ is false.

Can one safely replace the original hypothesis by the revised one, using the following argument? Suppose $\phi$ is not defined for some values of $x$. Then pick some "dummy" $y'$ (such as $\emptyset$) and let $\phi(x,y')$ be true. Then apply the revised axiom to conclude the original version of the axiom, with some technicalities to handle the fact that $Y$ might now include an extra element $y'$. I don't really do set theory, so it's not clear to me exactly what technicalities would pop up and whether they can be handled, possibly using the other axioms.

I've read a lot about different ways to define the Axiom of Replacement, and the related Axiom of Collection, but no one ever seems to state the hypothesis in exactly this way, so I'm wondering if something goes wrong if you try to use this formulation of the axiom.

**(Update: question after here answered in comments)** ~~For that matter, is the uniqueness of $y$ even required, or could the axiom be revised to $[\forall x \exists y\ \phi(x,y)] \implies [\forall X \exists Y \forall y\ (y \in Y \iff (\exists x \in X)\ \phi(x,y))]$?~~