Depends how close the cop is to me. If I can run and I know I can get away, like the cop is still a few hundred yards back or something, then I'll do that. But my rule of thumb with cops is be as nice to them as I can. If its obvious I have shit on me, I might just come clean. I never have more than an 1/8 and some paps or a pipe, so I'm not TOOO worried. I'm pretty sure most cops up here realize there's worse things to worry about than a harmless stoner. I know a person who got caught with a ton of dime bags on him, obviously selling, but he was straight forward with the cop and nice and all, and the cop took half the dimmeys for himself and my friend only got charged with possession, waaaay better than intent to deal. So honestly, if I had my shit hidden or I knew the cop wouldn't have thelegal grounds to search for it (though thats getting kinda shakey now-a-days) I'd deny, but if I knew I was in trouble, just be honest. And remember, if you run, the cop is just going to be that much more pissed off at you when (s)he catches you.
If it's a joint, I'd throw it away or hide it nearby and just act cool. If it's a pipe I'd put it in my pocket. The main thing to do is to act cool. Treat teh cops with respect. No matter how much you hate cops, treat them with respect. i for one don't hate cops and I get pissed off when I hear about people hating cops for what they did to them, even when the person had it coming. If they say jump, you ask how high. If you're cool, they usually won't bother you. Unless you really do get a prick, which fortunatley I haven't encountered one, besides my grandfather, but he's retired.