The deal comes after Talbot has been on a steady decline for a season and a half, eventually losing his job in Edmonton to Mikko Koskinen.
Talbot, 31, has a 3.36 goals-against average and .893 save percentage in 31 games this season. That comes after he had a 3.02 GAA and .908 save percentage the season before.
Those numbers are a far cry from his 2016-17 season, when his league-leading 42 wins, 2.39 GAA and .919 save percentage helped the Oilers break a decade-long playoff drought. Edmonton made it to the second round before bowing out, and with star Connor McDavid and a steady Talbot, the future looked promising.
But the Oilers missed the playoffs last season and are on the outside looking in this season.
Talbot is in the final season of a three-year contract with a cap hit of $4.167 million. When he gets a start, Talbot would help Philadelphia set an NHL record by becoming the eighth starting goalie to appear in a game this season for the Flyers.
Stolarz, 25, was in the Flyers organization for seven seasons after being a second-round pick by Philadelphia in 2012. He has appeared in 19 career NHL games with a 6-4-4 record, 2.86 GAA and .911 save percentage.
The Associated Press contributed to this report.