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 } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 27
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 27
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/jtlmq
function name:  (null)
number of ops:  29
compiled vars:  !0 = $xml, !1 = $keys, !2 = $h, !3 = $name, !4 = $hotId, !5 = $vybavení, !6 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'simplexml_load_file'
          1        SEND_VAL                                                 'http%3A%2F%2Faffiliate.dovolena.cz%2Fxml_hotels.php%3Faffiliate%3D1338%26key%3Dba154bbabc8357b3d9d3a16d39472b9bf5815f5e%26cid%3D7240'
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
    3     4        INIT_METHOD_CALL                                         !0, 'xpath'
          5        SEND_VAL_EX                                              'hotel'
          6        DO_FCALL                                      0  $9      
          7        ASSIGN                                                   !1, $9
    4     8      > FE_RESET_R                                       $11     !1, ->27
          9    > > FE_FETCH_R                                               $11, !2, ->27
    5    10    >   INIT_FCALL                                               'trim'
         11        FETCH_OBJ_R                                      ~12     !2, 'name'
         12        SEND_VAL                                                 ~12
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !3, $13
    6    15        FETCH_OBJ_R                                      ~15     !2, 'hotId'
         16        ASSIGN                                                   !4, ~15
    7    17        FETCH_OBJ_R                                      ~17     !2, 'properties'
         18        FETCH_OBJ_R                                      ~18     ~17, 'property'
         19        ASSIGN                                                   !5, ~18
    9    20        FETCH_OBJ_R                                      ~20     !2, 'properties'
         21        FETCH_OBJ_R                                      ~21     ~20, 'property'
         22      > FE_RESET_R                                       $22     ~21, ->25
         23    > > FE_FETCH_R                                               $22, !6, ->25
         24    > > JMP                                                      ->23
         25    >   FE_FREE                                                  $22
    4    26      > JMP                                                      ->9
         27    >   FE_FREE                                                  $11
   13    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
205.3 ms | 1461 KiB | 15 Q