The following code:
code:
$i = 1;
while($i < 100000){
$string .= '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<';
$i++;
}
$string = htmlspecialchars($string);
Took 0.65 seconds on my server. Bearing mind that it does 100,000 concatenation tasks before parsing the 3mb string that contains nothing but html special characters, it's not a difficult or time consuming business.