Most commercial formulations of hydrocodone syrup have preservatives in them to prevent bacterial growth. if it's still a clear syrupy liquid without any strange smells, it's fine to drink. If there's shit floating in it, throw it out.
generally people don't just swig out of a bottle of cough syrup. the chance that it's contaminated with anything is very low.