Nit: sizeof(ph) is never 0.