3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function StripBadXMLChars($xml) { return preg_replace('/[^\\x0009\\x000A\\x000D\\x0020-\\xD7FF\\xE000-\\xFFFD]/', ' ', $xml); } $str = "test\x0Atest"; print(StripBadXMLChars($str)); ?>
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/iclGN on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PUBLIC in /in/iclGN on line 3
Process exited with code 255.

preferences:
183.8 ms | 1395 KiB | 66 Q