Note: if you are in the EU, settle for nothing less than a new phone (rather than refurbished).
There was recently a lawsuit in the Netherlands where someone sued Apple after receiving a refurbished phone after replacement under warranty [1]. She won the case:
The judge based his verdict on a verdict of the European Court of Justice [2], so it's likely that the outcome would be the same in other EU countries.
[1] 20 months would still fall under warranty in the EU.
What's tong with refurbished? With regular devices, only a few are tested each batch. With refurbished, every single piece of the device should be tested.