3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('Content-type: text/plain'); $xml =<<<XML <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- Generated MAC-phone1.cfg Configuration File --> <polycomConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="polycomConfig.xsd"> <reg reg.1.auth.userId="xxx" reg.1.address="" reg.1.label="" reg.1.auth.password="" reg.1.lineKeys="" reg.1.server.1.address="" reg.1.server.2.address="" reg.2.auth.userId="" reg.2.address="" reg.2.label="" reg.2.auth.password="" reg.2.lineKeys="" reg.2.server.1.address="" reg.2.server.2.address="" reg.3.auth.userId="" reg.3.address="" reg.3.label="" reg.3.auth.password="" reg.3.lineKeys="" reg.3.server.1.address="" reg.3.server.2.address="" reg.4.auth.userId="" reg.4.address="" reg.4.label="" reg.4.auth.password="" reg.4.lineKeys="" reg.4.server.1.address="" reg.4.server.2.address="" reg.5.auth.userId="" reg.5.address="" reg.5.label="" reg.5.auth.password="" reg.5.lineKeys="" reg.5.server.1.address="" reg.5.server.2.address="" reg.6.auth.userId="" reg.6.address="" reg.6.label="" reg.6.auth.password="" reg.6.lineKeys="" reg.6.server.1.address="" reg.6.server.2.address="" reg.7.auth.userId="" reg.7.address="" reg.7.label="" reg.7.auth.password="" reg.7.lineKeys="" reg.7.server.1.address="" reg.7.server.2.address="" reg.8.auth.userId="" reg.8.address="" reg.8.label="" reg.8.auth.password="" reg.8.lineKeys="" reg.8.server.1.address="" reg.8.server.2.address="" reg.9.auth.userId="" reg.9.address="" reg.9.label="" reg.9.auth.password="" reg.9.lineKeys="" reg.9.server.1.address="" reg.9.server.2.address="" reg.10.auth.userId="" reg.10.address="" reg.10.label="" reg.10.auth.password="" reg.10.lineKeys="" reg.10.server.1.address="" reg.10.server.2.address="" reg.11.auth.userId="" reg.11.address="" reg.11.label="" reg.11.auth.password="" reg.11.lineKeys="" reg.11.server.1.address="" reg.11.server.2.address="" reg.12.auth.userId="" reg.12.address="" reg.12.label="" reg.12.auth.password="" reg.12.lineKeys="" reg.12.server.1.address="" reg.12.server.2.address="" /> <nat nat.keepalive.interval="30" /> <device><device.sntp device.sntp.serverName=""></device.sntp></device> <tcpIpApp><tcpIpApp.sntp tcpIpApp.sntp.address=""></tcpIpApp.sntp></tcpIpApp> <microbrowser><idleDisplay mb.idleDisplay.home="" /></microbrowser> <dir><dir.local dir.local.readonly=""></dir.local></dir> </polycomConfig> XML; $dom = new DOMDocument(); $dom->loadXML($xml); $xpath = new DOMXPath($dom); $data = array("reg.1.auth.userId" => "4408", "reg.1.line" => "Line 1", "fnord" => "fnord"); foreach ($data as $attr => $value) { if (trim($value) == "") { continue; } foreach($xpath->query( "//*[@$attr]") as $node) { $node->setAttribute($attr, $value); } } var_dump($dom->saveXML());
Output for 5.0.0 - 7.1.0
string(2311) "<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- Generated MAC-phone1.cfg Configuration File --> <polycomConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="polycomConfig.xsd"> <reg reg.1.auth.userId="4408" reg.1.address="" reg.1.label="" reg.1.auth.password="" reg.1.lineKeys="" reg.1.server.1.address="" reg.1.server.2.address="" reg.2.auth.userId="" reg.2.address="" reg.2.label="" reg.2.auth.password="" reg.2.lineKeys="" reg.2.server.1.address="" reg.2.server.2.address="" reg.3.auth.userId="" reg.3.address="" reg.3.label="" reg.3.auth.password="" reg.3.lineKeys="" reg.3.server.1.address="" reg.3.server.2.address="" reg.4.auth.userId="" reg.4.address="" reg.4.label="" reg.4.auth.password="" reg.4.lineKeys="" reg.4.server.1.address="" reg.4.server.2.address="" reg.5.auth.userId="" reg.5.address="" reg.5.label="" reg.5.auth.password="" reg.5.lineKeys="" reg.5.server.1.address="" reg.5.server.2.address="" reg.6.auth.userId="" reg.6.address="" reg.6.label="" reg.6.auth.password="" reg.6.lineKeys="" reg.6.server.1.address="" reg.6.server.2.address="" reg.7.auth.userId="" reg.7.address="" reg.7.label="" reg.7.auth.password="" reg.7.lineKeys="" reg.7.server.1.address="" reg.7.server.2.address="" reg.8.auth.userId="" reg.8.address="" reg.8.label="" reg.8.auth.password="" reg.8.lineKeys="" reg.8.server.1.address="" reg.8.server.2.address="" reg.9.auth.userId="" reg.9.address="" reg.9.label="" reg.9.auth.password="" reg.9.lineKeys="" reg.9.server.1.address="" reg.9.server.2.address="" reg.10.auth.userId="" reg.10.address="" reg.10.label="" reg.10.auth.password="" reg.10.lineKeys="" reg.10.server.1.address="" reg.10.server.2.address="" reg.11.auth.userId="" reg.11.address="" reg.11.label="" reg.11.auth.password="" reg.11.lineKeys="" reg.11.server.1.address="" reg.11.server.2.address="" reg.12.auth.userId="" reg.12.address="" reg.12.label="" reg.12.auth.password="" reg.12.lineKeys="" reg.12.server.1.address="" reg.12.server.2.address=""/> <nat nat.keepalive.interval="30"/> <device><device.sntp device.sntp.serverName=""/></device> <tcpIpApp><tcpIpApp.sntp tcpIpApp.sntp.address=""/></tcpIpApp> <microbrowser><idleDisplay mb.idleDisplay.home=""/></microbrowser> <dir><dir.local dir.local.readonly=""/></dir> </polycomConfig> "
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/OBNQi on line 29
Process exited with code 255.
Output for 4.4.2
Fatal error: Cannot instantiate non-existent class: domdocument in /in/OBNQi on line 30
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/OBNQi on line 29