A better answer probably would have been "Oh yea, it just happened tonight, I'm going to call my insurance company and get it taken care of when they open in the morning" instead of "I know the law, here it is!!!!!"
I once got pulled over for a headlight being out, and truth is, it did happen just that same night. Cop couldn't give me a ticket for it though. Why? Because right before he pulled me over I had stopped at an auto parts store and bought a replacement headlight, it was one of those all in one units, not just a bulb, and I was heading home to replace it. I'm sure a judge would toss out a ticket if I showed him my receipt for a headlight time stamped 10 minutes before the ticket.