3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dom = new DOMDocument('1.0', 'utf-8'); $rootNode = $dom->createElement('OTA_VehAvailRateRQ'); $rootNode->setAttribute('PrimaryLangID', 'EN'); $rootNode->setAttribute('TimeStamp', 'EN'); $rootNode->setAttribute('Target', 'EN'); $rootNode->setAttribute('Version', 'EN'); $rootNode->setAttribute('TransactionIdentifier', 'EN'); $rootNode->setAttribute('SequenceNmbr', 'EN'); $rootNode->setAttribute('MaxResponses', 'EN'); // $POSNode = $dom->createElement('POS'); $dom->appendChild($rootNode); echo $dom->saveXML();
based on 4te0e
Output for 5.0.0 - 7.2.0
<?xml version="1.0" encoding="utf-8"?> <OTA_VehAvailRateRQ PrimaryLangID="EN" TimeStamp="EN" Target="EN" Version="EN" TransactionIdentifier="EN" SequenceNmbr="EN" MaxResponses="EN"/>
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/hVBEu on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/hVBEu on line 3