McDonald's (MCD -0.05%) continues to carve out market share in spite of recent price hikes. The fast-food giant enjoyed its ninth straight quarter of comparable sales growth, with global sales increasing almost 10% year over year.

Let's take a closer look at the company's third-quarter performance and future outlook.

Gaining market share across the board

With nearly 40,000 locations across more than 100 countries, McDonald's leads the world in fast-food retail. It's not just flipping burgers -- the company has recently flipped the current sales trend on its head. While most other chains are seeing a decrease in traffic after raising prices, McDonald's has actually observed the opposite.

Even after raising its prices an average of 10% in the past year, the Big Mac maker continues to gain market share across the board -- from both lower- and higher-income customers. Some of the added traffic in the third quarter was actually the result of trade down, or when customers choose lower-priced items to save money.

McDonald's did observe some trade down among its lower-income diners, but it was primarily a shift from meal purchases to value menu items. In other words, although some lower-income customers traded down, they still chose to eat at McDonald's.

During the Q3 earnings call, CFO Ian Borden said that market share gains among low-income consumers can be attributed to McDonald's being "positioned as the leading brand in terms of value for money and affordability."

And that same trade-down effect is ironically what brought many of McDonald's new higher-income consumers in the restaurant's doors to begin with. As CEO Chris Kempczinski explained during the earnings call, trade down helped customers who would've eaten at a more expensive restaurant choose McDonald's instead.

Turbulent economic times

Like other restaurant chains, McDonald's has struggled with inflation's effect on consumer behavior. With many would-be diners eating at home to save money, the current economic climate impacted net sales, which dropped 5% year over year to $5.87 billion.

The weakening of all major currencies against the U.S. dollar has also been a major headwind for McDonald's all year, and the company expects it to impact fourth-quarter earnings as well.

In addition, the company says China has been a "challenging operating environment" due to ongoing COVID-19 restrictions. However, McDonald's was able to offset China's dismal sales with strong international revenue in Brazil and Japan -- other countries where licensees operate McDonald's stores.

Last but not least, the closure of McDonald's locations in Russia impacted the company substantially. When McDonald's chose to sell its 850 stores in Russia because of the country's invasion of Ukraine, it effectively cut out 2% of systemwide sales, 7% of revenue, and 2% of operating income for the corporation. McDonald's was forced to temporarily close many locations across Ukraine as well, many of which remain shuttered.

Digital sales lead the way

Despite the uncertain economic climate, McDonald's Q3 performance exceeded expectations. The previously mentioned Q3 revenue of $5.87 billion and earnings per share of $2.68 both beat analyst estimates, which had factored in the company's myriad challenges. Global comparable sales saw a 9.5% increase, with growth observed "across all segments."

A major growth pillar for McDonald's, digital sales drove nearly $7 billion of sales in McDonald's top six markets, accounting for more than 33% of sales in those markets. According to Kempczinski, "Our loyalty program is driving growth and exceeding expectations." In the U.S. alone, McDonald's boasts over 25 million active members of its digital rewards program -- contributing to a total of more than 43 million active users worldwide.

In the U.S., same-store sales increased 6.1% in the third quarter, thanks to more customer visits, price increases, and marketing promotions. Internationally, same-store sales growth saw a more impressive 8.5% increase. In McDonald's international licensed markets, same-store sales jumped a remarkable 16.7%, even with China's sales declines taken into account.

After releasing its Q3 earnings numbers, McDonald's stock reached a new all-time-high price just shy of $275. With such strong investor support, if McDonald's can continue to carve market share and show resilience in the face of uncertainty, watch for this fast-food stock to keep printing new highs.