Fosfor has put together a great comparison test between the cameras of the iPhone 3G, 3GS, iPhone 4 and iPhone 4 with HDR. The results are much what you’d expect, but the degree of differences between the cameras is even more drastic than I thought.
All in all the iPhone 4 camera with HDR performs cartwheels around the in-brand competition. You can see for yourself with the results I’ve provided here, but for even more head over to the source. They’ve also used a Canon as a sort of digital camera control.