I dont know if anything like this exists but i was hoping someone might have some helpful tips.
I was looking for a program that will run PHP code with random variable values to output all possible outcomes of HTML code and show validation errors if a certain combination of variables is set.
I think there are 2 approaches that would suit you best:
1. Hijack the W3C HTML validation service. - Not recommended.
2. Use pregs, and strips to check for bad tags etc.