I am simulating an attack and I can't figure out why htmlspecialchars() is causing a parse error as in:

PHP Code:
$char htmlspecialchars("while (1) alert ("Gotcha!");",ENT_COMPAT);