Closest I've gotten is on a solo flight after some forced landing practice. The forced landing practice had not gone well - among other things I picked a particularly bad field, with lots of rocks, fences, power lines, livestock, trees, etc etc. right next to a perfectly good and deserted road.
Anyway, because of that I decided I needed more practice before the next instructor lesson, so I was tooling around in the training area "suprising" myself occasionally by pulling the throttle off at sort-of random times. On the 5th attempt as I was putting the power back on at 500ft AGL (after managing to get really well lined up for landing in a paddock) the engine coughed, spluttered and mostly died. Naturally enough I freaked a bit, but the checks came through and I found the carby heat off straight away. As soon as it was applied the engine ran fine (it hadn't quite died).
I left it on for a couple of minutes as I headed back to the airfield, where I did a couple of touch and gos and a couple more "engine failures", all without incident.