In this paper, we introduce and study the class of $phi$-$w$-flat modules which are generalizations of both $phi$-flat modules and $w$-flat modules. The $phi$-$w$-weak global dimension $phi$-$w$-w.gl.dim$(R)$ of a commutative ring $R$ is also introduced and studied. We show that, for a $phi$-ring $R$, $phi$-$w$-w.gl.dim$(R)=0$ if and only if $w$-$dim(R)=0$ if and only if $R$ is a $phi$-von Neumann ring. It is also proved that, for a strongly $phi$-ring $R$, $phi$-$w$-w.gl.dim$(R)leq 1$ if and only if each nonnil ideal of $R$ is $phi$-$w$-flat, if and only if $R$ is a $phi$-PvMR, if and only if $R$ is a PvMR.