3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = "0;78d13qqoglyszmorspfwfdmwffgnubgr;\u003c?dpf sent len=\"1\"?\u003e\u003c?dpf orth code=\"unknown\" prop=\"Lesen;Lehnen;Lehren;Leasen;Leisen\" ?\u003elehsen\u003c?dpf /orth ?\u003e~~~\u003c?dpf /sent ?\u003e"; $response = preg_replace("/\\\\u([0-9a-f]{3,4})/i", "&#x\\1;", $response); $response = html_entity_decode($response , null, 'UTF-8'); $response = str_replace([ '<?dpf ', ' ?>', '?>' ], [ '<', '>', '>' ], $response); $response = substr($response, 36-1); echo $response; echo "\n"; $xml = simplexml_load_string($response ); $xml = toArray($xml); print_r($xml); function toArray($xml) { $array = json_decode(json_encode($xml), true); foreach ( array_slice($array, 0) as $key => $value ) { if ( empty($value) ) $array[$key] = NULL; elseif ( is_array($value) ) $array[$key] = toArray($value); } return $array; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ra7t0
function name:  (null)
number of ops:  38
compiled vars:  !0 = $response, !1 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '0%3B78d13qqoglyszmorspfwfdmwffgnubgr%3B%5Cu003c%3Fdpf+sent+len%3D%221%22%3F%5Cu003e%5Cu003c%3Fdpf+orth+code%3D%22unknown%22+prop%3D%22Lesen%3BLehnen%3BLehren%3BLeasen%3BLeisen%22+%3F%5Cu003elehsen%5Cu003c%3Fdpf+%2Forth+%3F%5Cu003e%7E%7E%7E%5Cu003c%3Fdpf+%2Fsent+%3F%5Cu003e'
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5C%5Cu%28%5B0-9a-f%5D%7B3%2C4%7D%29%2Fi'
          3        SEND_VAL                                                 '%26%23x%5C1%3B'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    5     7        INIT_FCALL                                               'html_entity_decode'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 null
         10        SEND_VAL                                                 'UTF-8'
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !0, $5
    6    13        INIT_FCALL                                               'str_replace'
         14        SEND_VAL                                                 <array>
         15        SEND_VAL                                                 <array>
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !0, $7
    8    19        INIT_FCALL                                               'substr'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 35
         22        DO_ICALL                                         $9      
         23        ASSIGN                                                   !0, $9
   10    24        ECHO                                                     !0
   11    25        ECHO                                                     '%0A'
   13    26        INIT_FCALL                                               'simplexml_load_string'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $11     
         29        ASSIGN                                                   !1, $11
   14    30        INIT_FCALL_BY_NAME                                       'toArray'
         31        SEND_VAR_EX                                              !1
         32        DO_FCALL                                      0  $13     
         33        ASSIGN                                                   !1, $13
   15    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
   26    37      > RETURN                                                   1

Function toarray:
Finding entry points
Branch analysis from position: 0
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
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 28
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/Ra7t0
function name:  toArray
number of ops:  32
compiled vars:  !0 = $xml, !1 = $array, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'json_decode'
          2        INIT_FCALL                                               'json_encode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        SEND_VAR                                                 $4
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
   20     9        INIT_FCALL                                               'array_slice'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 0
         12        DO_ICALL                                         $7      
         13      > FE_RESET_R                                       $8      $7, ->29
         14    > > FE_FETCH_R                                       ~9      $8, !2, ->29
         15    >   ASSIGN                                                   !3, ~9
   21    16        ISSET_ISEMPTY_CV                                         !2
         17      > JMPZ                                                     ~11, ->21
         18    >   ASSIGN_DIM                                               !1, !3
         19        OP_DATA                                                  null
         20      > JMP                                                      ->28
   22    21    >   TYPE_CHECK                                  128          !2
         22      > JMPZ                                                     ~13, ->28
         23    >   INIT_FCALL_BY_NAME                                       'toArray'
         24        SEND_VAR_EX                                              !2
         25        DO_FCALL                                      0  $15     
         26        ASSIGN_DIM                                               !1, !3
         27        OP_DATA                                                  $15
   20    28    > > JMP                                                      ->14
         29    >   FE_FREE                                                  $8
   25    30      > RETURN                                                   !1
   26    31*     > RETURN                                                   null

End of function toarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.75 ms | 1400 KiB | 31 Q