In a synthesis reaction, two or more reagents react to form a new product. In decomposition reactions, a single reagent is separated into two or more new products.
According to the given equations:
Phosphorus and hydrogen react to form a new product which is phosphane.
It means that the first is a synthesis reaction.
Hydrogen and oxygen react to form a new product which is water.
It means that the second is also a synthesis reaction.