  We provide an analytic proof of a theorem of Krylov dealing with global
$C^{1,1}$ estimates to solutons of degenerate complex Monge-Amp\`ere equations.
As an application we show optimal regularity for various extremal functions
with nonconstant boundary values.
