3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = "\xC2<script+%C2>alert(1);//%C2</script+%C2>"; function mb_htmlescape($s) { mb_regex_encoding('UTF-8'); $s = mb_ereg_replace('&', '&amp;', $s); $s = mb_ereg_replace('<', '&lt;', $s); $s = mb_ereg_replace('>', '&gt;', $s); $s = mb_ereg_replace('"', '&quot;', $s); return $s; } ?> <?php echo mb_htmlescape($x); <?php echo htmlspecialchars($x);
Output for 7.0.0 - 7.0.5
Parse error: syntax error, unexpected '<', expecting end of file in /in/egDfr on line 13
Process exited with code 255.
Output for 5.5.0 - 5.5.34, 5.6.0 - 5.6.20
Parse error: syntax error, unexpected '<' in /in/egDfr on line 13
Process exited with code 255.

preferences:
180.82 ms | 1395 KiB | 68 Q