NEW YORK - U.S. stocks on Tuesday extended multiyear highs, with the Dow Jones industrial average up for a seventh session, after McDonald's Corp. posted better-than-expected sales.

The Dow industrials closed up 71.52 points, or 0.6 percent, at 12,233.15, the highest close since June 16, 2008. All but six of its 30 components tallied gains, led by McDonald's. The fast-food giant's shares rose 2.6 percent after it reported better-than-expected gains in sales in every part of the globe except the United States in January.

The gain pushed the Dow's daily winning streak to its longest in nearly seven months, since the seven-session stretch that ended July 14, 2010.

Investors have increasingly focused on largely positive corporate results the past week, overlooking uncertainty clouding Egypt's leadership change and on Tuesday, China's latest interest-rate increase to tamp down inflation.

"If trends continue with the firms left to report, fourth-quarter 2010 could be the seventh consecutive quarter of earnings outperformance by 70 percent or more of companies," noted William Stone, chief investment strategist at PNC Financial Services Group.

The Standard & Poor's 500 index ended up 5.52 points, or 0.4 percent, to 1,324.57, the highest close since June 19, 2008. Consumer-discretionary shares fared the best and energy ranked the worst among its 10 industry groups.

The Nasdaq composite index added 13.06 points, or 0.5 percent, to 2,797.05, the highest since Nov. 6, 2007.

"The market was weak early on because of China raising rates; we're obviously worried about the implications for global economic growth," said Michael Gibbs, director of equity strategy at Morgan Keegan, referring to China's third interest-rate increase since mid-October.

Yet "investors have this burning desire to buy the dips right now, so they keep piling in on any sign of weakness," he added.