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.4.0 - 5.4.10
Parse error: syntax error, unexpected 'echo' (T_ECHO) in Fhb2i on line 24
Process exited with code 255.
Output for 5.3.0 - 5.3.20
Parse error: syntax error, unexpected T_ECHO in Fhb2i on line 24
Process exited with code 255.

preferences:
187.46 ms | 1395 KiB | 39 Q