You will need EVERY SINGLE MINUTE of that connection in IAD coming home. The airport is the seventh circle of hell when it comes to making it through Customs & Immigration.
By July, the weather shouldn't be too bad in Philly. IAD is less prone to flight delays since it's further away from the coast and has more runways operational in bad weather.