Suppose I have a simple functional $$F=\int{dx\;\phi^{*}(x)\phi(x)}\tag{1}.$$ Assuming $\phi(x)$ and $\phi^{*}(x)$ are independent and I take a functional differential with respect to $\phi(x)$ and $\phi^{*}(x)$ and I will get the following answers.
\begin{equation} \frac {\delta F} {\delta \phi(x)}=\phi^{*}(x)\\ \frac {\delta F} {\delta \phi^*(x)}=\phi(x)\tag{2} \end{equation}
On the other hand, if I think that functional depends only on real field $\phi$ \begin{equation} F=\int{dx\;|\phi(x)|^2}. \tag{3} \end{equation} the functional differential will give,
\begin{equation} \frac {\delta F} {\delta |\phi(x)|}=2|\phi(x)| \\ \frac {\delta F} {\delta |\phi^*(x)|}=0\tag{4} \end{equation}
Now I suppose that the field is going to a real field (Imaginary part goes to zero) and we take the limit that $\phi^* \to \phi$ then $|\phi(x)|=\phi(x)$.Then we have a contradiction that $\frac {\delta F} {\delta \phi(x)}=\phi(x)$ but from the second consideration we have $\frac {\delta F} {\delta \phi(x)}=2\phi(x)$. So there is a discrepancy of a factor 2! Can anybody enlighten me?