3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = simplexml_load_file("http://affiliate.dovolena.cz/xml_hotels.php?affiliate=1338&key=ba154bbabc8357b3d9d3a16d39472b9bf5815f5e&cid=7240"); $keys = $xml->xpath("hotel"); //hotel jsou jednotlivé položky foreach ($keys as $h) { $name = trim($h->name); $hotId = $h->hotId; $vybavení = $h->properties->property;//v případě, že xml je "hlubší" a má jen 1 hodnotu //tady může být podmínka, kontr. echo ap... foreach($h->properties->property as $p) { //v případě, že xml je "hlubší" a property obsahuje vícehodnot //echo $p->neco; // vypíše všechny hodnoty neco od daného hotelu resp. položky } } ?>
Output for git.master, git.master_jit
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo for affiliate.dovolena.cz failed: System error in /in/jtlmq on line 2 Warning: simplexml_load_file(http://affiliate.dovolena.cz/xml_hotels.php?affiliate=1338&key=ba154bbabc8357b3d9d3a16d39472b9bf5815f5e&cid=7240): Failed to open stream: php_network_getaddresses: getaddrinfo for affiliate.dovolena.cz failed: System error in /in/jtlmq on line 2 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://affiliate.dovolena.cz/xml_hotels.php?affiliate=1338&key=ba154bbabc8357b3d9d3a16d39472b9bf5815f5e&cid=7240" in /in/jtlmq on line 2 Fatal error: Uncaught Error: Call to a member function xpath() on bool in /in/jtlmq:3 Stack trace: #0 {main} thrown in /in/jtlmq on line 3
Process exited with code 255.
Output for rfc.property-hooks
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo for affiliate.dovolena.cz failed: System error in /in/jtlmq on line 2 Warning: simplexml_load_file(http://affiliate.dovolena.cz/xml_hotels.php?affiliate=1338&key=ba154bbabc8357b3d9d3a16d39472b9bf5815f5e&cid=7240): Failed to open stream: php_network_getaddresses: getaddrinfo for affiliate.dovolena.cz failed: System error in /in/jtlmq on line 2 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://affiliate.dovolena.cz/xml_hotels.php?affiliate=1338&key=ba154bbabc8357b3d9d3a16d39472b9bf5815f5e&cid=7240" in /in/jtlmq on line 2 Fatal error: Uncaught Error: Call to a member function xpath() on false in /in/jtlmq:3 Stack trace: #0 {main} thrown in /in/jtlmq on line 3
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:
59.7 ms | 408 KiB | 5 Q