3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = <<<XML <html> <head><title></title></head> <body> <CONTENT type="text"/> </body> </html> XML; $dom = new DOMDocument(); $dom->loadXML($xml); $c = $dom->createTextNode("<h1>heading</h1>"); $c->wholeText; $oldc = $dom->getElementsByTagName("CONTENT")->item(0); $oldc->parentNode->appendChild($c); $oldc->parentNode->removeChild($oldc); // echo $dom->saveHTML();
Output for 5.0.0 - 5.0.5, 5.1.1 - 7.1.0
Output for 5.1.0
<br /> <b>Fatal error</b>: fatal flex scanner internal error--end of buffer missed in <b>/in/eljA2</b> on line <b>17</b><br />
Process exited with code 255.
Output for 4.4.3 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_OBJECT_OPERATOR in <b>/in/eljA2</b> on line <b>14</b><br />
Process exited with code 255.
Output for 4.4.2
<br /> <b>Parse error</b>: syntax error, unexpected T_OBJECT_OPERATOR in <b>/in/eljA2</b> on line <b>15</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_OBJECT_OPERATOR in <b>/in/eljA2</b> on line <b>14</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error in <b>/in/eljA2</b> on line <b>14</b><br />
Process exited with code 255.