Effect of functional groups on the thermal degradation of phosphorus- and phosphorus/nitrogen-containing functional polymers