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); } $fc = simplexml_load_string('<p:FatturaElettronica versione="1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:p="http://www.fatturapa.gov.it/sdi/fatturapa/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><FatturaElettronicaHeader><FatturaElettronicaBody></FatturaElettronicaBody></FatturaElettronicaHeader></p:FatturaElettronica> ','SimpleXMLElement', LIBXML_NOCDATA); /* creo un DOMElements dal SimpleXMLElements */ $domdocument = dom_import_simplexml($fc); /* Creo un DOMElements per ogni elemento della fattura */ $dt = dom_import_simplexml(getDatiTrasmissione()); $dt = $domdocument->FatturaElettronicaHeader->importNode($dt, TRUE); $domdocument->appendChild($dt);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined property: DOMElement::$FatturaElettronicaHeader in /in/c4gZE on line 34 Fatal error: Uncaught Error: Call to a member function importNode() on null in /in/c4gZE:34 Stack trace: #0 {main} thrown in /in/c4gZE on line 34
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:
48.94 ms | 405 KiB | 9 Q