Don't tell Dollar Tree (NASDAQ:DLTR) we're in a difficult economic environment. Before drifting back down a bit yesterday, Dollar Tree's shares shot up 5.4% on Wednesday, on word of favorable quarterly results.

The company earned $0.33 a share, 18% higher than a year ago. That's no real surprise, since three weeks ago, it announced that same-store sales increased 4.4%, for the sixth straight quarter of better than 4% comps. Citing the strong comps increase and the associated leverage that comes from higher sales, management met its jacked-up earnings forecast of $0.32-$0.33 a share, and it also increased guidance for the year. That was a pleasant surprise, and it was what likely sent the stock higher. It now expects to earn $2.04-$2.14 a share for the year.

As for margins, the gross margin expanded 40 basis points, to 33.6%. The operating margin was essentially flat from a year ago, but excluding charges relating to settling employment litigation, it actually widened by 34 basis points.

The company is showing no ill effects from a consumer that has reportedly been strained by factors such as high gas and food prices, higher mortgages, and a housing slowdown. Competitors don't seem to be doing as well. There was a strong comps increase at 99 Cents Only Stores (NYSE:NDN), but it didn't translate into bottom-line growth. Family Dollar (NYSE:FDO) lowered its outlook for the year. Meanwhile, traffic increased at Dollar Tree's stores. My wife and kids helped ... they can always find an excuse to buy something there.

Rents may be getting higher, but Dollar Tree's stores -- many of which are in convenient strip-mall locations -- can attract middle-income customers, who are probably more immune to those pesky economic factors.

Unfortunately, even if its merchandise sells for a dollar a shot, I can't say the shares are cheap at 21 times trailing earnings. Enjoy your shopping, but I'd advise you to leave the shares on the shelf.

Related Foolishness:

Family Dollar is a former Stock Advisor pick. Check out the service free for 30 days to see what Tom and David Gardner are currently recommending.

Dollar Tree is a former Inside Value recommendation.

Fool contributor Larry Rothman is happy to receive feedback, and he promises to read it when he's not being wrestled by his three children. Feel free to email him at rothmanviews@comcast.net. He doesn't have any positions in the companies mentioned.