Retailer Marks & Spencer outdid market expectations in recording a marginal rise in UK like-for-like sales, when many analysts had predicted a 2.5% decline.