3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = new \SimpleXMLElement('<Request/>'); $authentication = $data->addChild('Authentication'); $authentication->addChild('client', "MERCHANT"); $authentication->addChild('password', "********"); $transaction = $data->addChild('Transaction'); $historicTxn = $transaction->addChild('HistoricTxn'); $historicTxn->addChild('reference', "REFREENCE"); $historicTxn->addChild('method', 'query'); print_r($data->saveXML());
based on 2IGVH
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
<?xml version="1.0"?> <Request><Authentication><client>MERCHANT</client><password>********</password></Authentication><Transaction><HistoricTxn><reference>REFREENCE</reference><method>query</method></HistoricTxn></Transaction></Request>