  In the first part of this work, we consider a polynomial $
\phi(x,y)=y^d+a_1(x)y^{d-1}+...+a_d(x) $ whose coefficients $ a_j $ belong to a
Denjoy-Carleman quasianalytic local ring $ \mathcal{E}_1(M) $. Assuming that $
\mathcal{E}_1(M) $ is stable under derivation, we show that if $ h $ is a germ
of $ C^\infty $ function such that $ \phi(x,h(x))=0 $, then $ h $ belongs to $
\mathcal{E}_1(M) $. This extends a well-known fact about real-analytic
functions. We also show that the result fails in general for non-quasianalytic
ultradifferentiable local rings. In the second part of the paper, we study a
similar problem in the framework of ultraholomorphic functions on sectors of
the Riemann surface of the logarithm. We obtain a result that includes suitable
non-quasianalytic situations.
