3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <html> <head><HEADER/></head> <body> <ul> <li><a href="page2">page2</a> </li> </ul> <CONTENT/> </body> <FOOTER/> </html> XML; $content = "<div id='main'>asdf asdf</div>"; $header = "<title>page 1</title>"; $footer = "<script type='text/javascript'></script>"; $doc = new DOMDocument(); $doc->loadXML($xml); $xp = new DOMXPath($doc); print_r($xp->evaluate("//HEADER | //CONTENT | //FOOTER");) //$ctag->parentNode->replaceChild(new DOMCdataSection($content),$ctag); echo $doc->saveHTML();
Output for 5.3.0 - 5.3.20, 5.4.0 - 5.4.10
Parse error: syntax error, unexpected ';' in oMZb7 on line 21
Process exited with code 255.

preferences:
173.78 ms | 1395 KiB | 39 Q