3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getDatiTrasmissione() { $header = ' <DatiTrasmissione> <IdTrasmittente> <IdPaese>IT</IdPaese> <IdCodice>01234567890</IdCodice> </IdTrasmittente> <ProgressivoInvio>00001</ProgressivoInvio> <FormatoTrasmissione>SDI10</FormatoTrasmissione> <CodiceDestinatario>AAAAAA</CodiceDestinatario> <ContattiTrasmittente> <Telefono>060601</Telefono> <Email>prova@mail.it</Email> </ContattiTrasmittente> </DatiTrasmissione>'; return simplexml_load_string($header,'SimpleXMLElement', LIBXML_NOCDATA); } $headerdoc = new DOMDocument; $headerdoc->formatOutput = true; $headerdoc->loadXML("<FatturaElettronicaHeader></FatturaElettronicaHeader>"); $node = dom_import_simplexml(getDatiTrasmissione()); $node = $headerdoc->ownerDocument->importNode($node, TRUE); // And then append it to the "<root>" node $headerdoc->appendChild($node); echo $headerdoc->asXML();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to a member function importNode() on null in /in/BvCOE:33 Stack trace: #0 {main} thrown in /in/BvCOE on line 33
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
62.48 ms | 401 KiB | 8 Q