3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = <<<EOD <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <book id="listing"> <title>My lists</title> </book> EOD; $doc = new DOMDocument; $doc->loadXML($xml) $book = $doc->documentElement; // we retrieve the chapter and remove it from the book $chapter = $book->getElementsByTagName('chapter')->item(0); // copy the namespace URI $nsuri = $book->namespaceURI; // Delete the child node $book->removeChild($chapter); // paste the namespace URI back into the parent node $book->namespaceURI = $nsuri;
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '$book' (T_VARIABLE) in /in/P1etY on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/P1etY on line 16
Process exited with code 255.