Use Z_TRY_ADDREF_P to avoid doing horrible things