Inflationary pressures slashed earnings and revenues for McDonald’s Corp. in the third quarter, but the company remains optimistic about its ability to navigate a steeper economic downturn in the coming months.

Net income for McDonald’s slipped 8% to $1.9 billion from the year prior, and revenues also dropped 5% to $5.8 billion, the company said Thursday. Earnings per share also lost 6% to land at $2.68.

The company’s declining revenue was driven mainly by slower sales at some company-owned restaurants (including lost business in Russia) and a loss of other revenues, like franchise fees, sales of restaurants and brand licensing agreements.

“It goes without saying that we are seeing global macroeconomic challenges that haven’t been experienced in many years,” said Ian Borden, the company’s chief financial officer and executive vice president, on Thursday’s earnings call.

McDonald’s, like its competitors, is contending with higher energy and labor costs, more spending on restaurant technology, China’s continued coronavirus lockdowns and an emerging slowdown in Europe. If inflation continues to stick, analysts predict that consumers might start eating more at home.

“Consumers have a lot less disposable income; they’re gonna have to tighten the belts,” said Sean Dunlop, an equity analyst at research firm Morningstar.

The company’s global footprint also creates a foreign currency effect – McDonald’s investments in other countries bring in a lower return because of the strong dollar.

But, investors and executives expressed confidence that McDonald’s will weather a recession. The company beat earnings per share, sales growth at stores open for at least a year and revenue expectations, and the stock price gained 3.31% Thursday to close at $265.11.

McDonald’s Corp. stock has gained 1.71% since the start of the year, outperforming the S&P 500, which has lost more than 18%.

“Ultimately, McDonald’s is pretty well positioned,” said Dunlop. “I don’t think the floor is going to fall out, necessarily.”

McDonald’s, Panera Bread Company and Chipotle Mexican Grill, Inc. outperformed their peers from 2006 to 2011 during the Great Recession, according to Morningstar Equity Research, which analysts see as a predictor of the company’s performance in a future downturn. While food service does feel the squeeze of price pressures, quick-service restaurants are an attractive option for cash-strapped diners and might be hedged against a recession.

McDonald’s doesn’t face a lot of fast-food competition in Europe, and the company was well-positioned for an industry-wide transition to more takeout and delivery prompted by the pandemic.

“They have successfully married the interface between technology and marketing,” said John Gordon, a restaurant subject matter expert at Pacific Management Consulting Group.

Plus, the company has seen buyers shift to cheaper products in restaurants, a sign that McDonald’s is gaining influence among low-income consumers as spending power contracts.

The company has also begun a series of marketing campaigns – among them, the Adult Happy Meal – designed to remind consumers that McDonald’s is not just a place to spend their shrinking disposable income. 

“I think what we, in the past, maybe didn’t do enough of is lean into our relevance and how our brand is a part of culture,” said Christopher J. Kempczinski,  the company’s chief executive officer and director.