An iPhone in most cases last more, you have the latest updates more easy 3 years. The hardware has good quality and the resale value is great. But, if you plan to use your smartphone as a computer, you may want an Android.
For me its Unix all the way down, thats why I recommend iPhone. Android does not have libc, its a java like vm on top of the kernel.