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 <Hotels1> <Hotel> <Mapper><ProviderSupplierName/></Mapper> </Hotel> </Hotels1> XML , <<<XML <Hotels1> <Hotel> <Mapper> <ProviderSupplierName/> </Mapper> </Hotel> </Hotels1> XML ); foreach($data as $resultXML){ echo $resultXML . PHP_EOL; $sxml = simplexml_load_string($resultXML); echo json_encode($sxml,LIBXML_NOBLANKS); 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 = 28
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 28
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 10
filename:       /in/tL5Z4
function name:  (null)
number of ops:  30
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, ->28
         14    > > FE_FETCH_R                                               $8, !1, ->28
   31    15    >   CONCAT                                           ~9      !1, '%0A'
         16        ECHO                                                     ~9
   32    17        INIT_FCALL                                               'simplexml_load_string'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !2, $10
   33    21        INIT_FCALL                                               'json_encode'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 256
         24        DO_ICALL                                         $12     
         25        ECHO                                                     $12
   34    26        ECHO                                                     '%0A'
   30    27      > JMP                                                      ->14
         28    >   FE_FREE                                                  $8
   35    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.86 ms | 1388 KiB | 19 Q