A 32-year-old man from Warsash was given a conditional discharge by magistrates for possessing a class A drug.
Richard James Horne, of Dibles Park in Dibles Road, pleaded guilty to having 80ml of methadone in his possession in Fareham on December 6 last year.
Portsmouth magistrates conditionally discharged Horne for 12 months and ordered that the 80ml of methadone should be forfeited and destroyed.
He also admitted a separate charge of stealing three tubes of toothpaste worth £8.25 from the Southern Co-Operative Ltd in Gosport on March 26.
Magistrates also discharged Horne conditionally for 12 months for that offence and ordered him to pay compensation of £8.25 and a victim surcharge of £15.