3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-Type: text/plain'); $str_xml = "<myxml><mytag><![CDATA[In this content, 8 > 2 & 1 < 9, and 10 is a 10% of 100. ]]></mytag></myxml>"; try { echo "XML with CDATA: \n\n"; $xml = simplexml_load_string($str_xml); echo $xml->asXML() ."\n\n"; } catch(Exception $e){ echo "XML with CDATA: \n\n"; echo $e->getMessage() ."\n\n"; }

preferences:
32.79 ms | 402 KiB | 5 Q