3v4l.org

run code in 300+ PHP versions simultaneously
<?php if( !function_exists('simplexml_load_string') || !function_exists('json_encode') ) die('Not supported yet'); $data = array( <<<XML <Hotels> <Hotel> <Mapper><ProviderSupplierName/></Mapper> </Hotel> </Hotels> XML , <<<XML <Hotels> <Hotel> <Mapper> <ProviderSupplierName/> </Mapper> </Hotel> </Hotels> XML ); foreach($data as $resultXML){ echo $resultXML . PHP_EOL; $sxml = simplexml_load_string($resultXML, 'SimpleXMLElement', LIBXML_NOBLANKS); echo json_encode($sxml); echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 29
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 10
filename:       /in/qaJlU
function name:  (null)
number of ops:  31
compiled vars:  !0 = $data, !1 = $resultXML, !2 = $sxml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'simplexml_load_string'
          2        DO_ICALL                                         $3      
          3        BOOL_NOT                                         ~4      $3
          4      > JMPNZ_EX                                         ~4      ~4, ->10
          5    >   INIT_FCALL                                               'function_exists'
          6        SEND_VAL                                                 'json_encode'
          7        DO_ICALL                                         $5      
          8        BOOL_NOT                                         ~6      $5
          9        BOOL                                             ~4      ~6
         10    > > JMPZ                                                     ~4, ->12
         11    > > EXIT                                                     'Not+supported+yet'
    5    12    >   ASSIGN                                                   !0, <array>
   30    13      > FE_RESET_R                                       $8      !0, ->29
         14    > > FE_FETCH_R                                               $8, !1, ->29
   31    15    >   CONCAT                                           ~9      !1, '%0A'
         16        ECHO                                                     ~9
   32    17        INIT_FCALL                                               'simplexml_load_string'
         18        SEND_VAR                                                 !1
         19        SEND_VAL                                                 'SimpleXMLElement'
         20        SEND_VAL                                                 256
         21        DO_ICALL                                         $10     
         22        ASSIGN                                                   !2, $10
   33    23        INIT_FCALL                                               'json_encode'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $12     
         26        ECHO                                                     $12
   34    27        ECHO                                                     '%0A'
   30    28      > JMP                                                      ->14
         29    >   FE_FREE                                                  $8
   35    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.63 ms | 1396 KiB | 19 Q