A Philadelphia police officer is recovering after investigators say a suspect's gun discharged while being frisked during a traffic stop overnight Monday.