3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xml2array($contents, $get_attributes = 1, $priority = 'tag') { if (!$contents) { return array(); } if (!function_exists('xml_parser_create')) { //print "'xml_parser_create()' function not found!"; return array(); } //Get the XML parser of PHP - PHP must have this module for the parser to work $parser = xml_parser_create(''); xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); // http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, trim($contents), $xml_values); xml_parser_free($parser); if (!$xml_values) { return;//Hmm... } //Initializations $xml_array = array(); $parents = array(); $opened_tags = array(); $arr = array(); $current = &$xml_array; //Refference //Go through the tags. $repeated_tag_index = array();//Multiple tags with same name will be turned into an array foreach ($xml_values as $data) { unset($attributes,$value);//Remove existing values, or there will be trouble //This command will extract these variables into the foreach scope // tag(string), type(string), level(int), attributes(array). extract($data);//We could use the array by itself, but this cooler. $result = array(); $attributes_data = array(); if (isset($value)) { if ($priority == 'tag') { $result = $value; } else { $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode } } //Set the attributes too. if (isset($attributes) and $get_attributes) { foreach ($attributes as $attr => $val) { if ($priority == 'tag') { $attributes_data[$attr] = $val; } else { $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' } } } //See tag status and do the needed. if ($type == "open") {//The starting of the tag '<tag>' $parent[$level-1] = &$current; if (!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag $current[$tag] = $result; if ($attributes_data) { $current[$tag. '_attr'] = $attributes_data; } $repeated_tag_index[$tag.'_'.$level] = 1; $current = &$current[$tag]; } else { //There was another element with the same tag name if (isset($current[$tag][0])) {//If there is a 0th element it is already an array $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result; $repeated_tag_index[$tag.'_'.$level]++; } else {//This section will make the value an array if multiple tags with the same name appear together $current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array $repeated_tag_index[$tag.'_'.$level] = 2; if (isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well $current[$tag]['0_attr'] = $current[$tag.'_attr']; unset($current[$tag.'_attr']); } } $last_item_index = $repeated_tag_index[$tag.'_'.$level]-1; $current = &$current[$tag][$last_item_index]; } } elseif ($type == "complete") { //Tags that ends in 1 line '<tag />' //See if the key is already taken. if (!isset($current[$tag])) { //New Key $current[$tag] = $result; $repeated_tag_index[$tag.'_'.$level] = 1; if ($priority == 'tag' and $attributes_data) { $current[$tag. '_attr'] = $attributes_data; } } else { //If taken, put all things inside a list(array) if (isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array... // ...push the new element into that array. $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result; if ($priority == 'tag' and $get_attributes and $attributes_data) { $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data; } $repeated_tag_index[$tag.'_'.$level]++; } else { //If it is not an array... $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value $repeated_tag_index[$tag.'_'.$level] = 1; if ($priority == 'tag' and $get_attributes) { if (isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well $current[$tag]['0_attr'] = $current[$tag.'_attr']; unset($current[$tag.'_attr']); } if ($attributes_data) { $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data; } } $repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken } } } elseif ($type == 'close') { //End of tag '</tag>' $current = &$parent[$level-1]; } } return($xml_array); } $response = '<?xml version="1.0" encoding="utf-8"?> <returnMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.doublepositive.com/"> <ErrorName>Success</ErrorName> <ErrorDescription>Approved – Assigned to Order</ErrorDescription> <LeadID>260554022</LeadID> <ClientAvailable>true</ClientAvailable> <ClientName>Post University</ClientName> <PrimaryNumber>8884051175</PrimaryNumber> <BackupNumber /> </returnMessage>'; $data = xml2array($response); var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mCAvK
function name:  (null)
number of ops:  9
compiled vars:  !0 = $response, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  140     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0A%3CreturnMessage+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22+xmlns%3Axsd%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22+xmlns%3D%22http%3A%2F%2Fwww.doublepositive.com%2F%22%3E%0A++%3CErrorName%3ESuccess%3C%2FErrorName%3E%0A++%3CErrorDescription%3EApproved+%E2%80%93+Assigned+to+Order%3C%2FErrorDescription%3E%0A++%3CLeadID%3E260554022%3C%2FLeadID%3E%0A++%3CClientAvailable%3Etrue%3C%2FClientAvailable%3E%0A++%3CClientName%3EPost+University%3C%2FClientName%3E%0A++%3CPrimaryNumber%3E8884051175%3C%2FPrimaryNumber%3E%0A++%3CBackupNumber+%2F%3E%0A%3C%2FreturnMessage%3E'
  151     1        INIT_FCALL                                               'xml2array'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
  153     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function xml2array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 45
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 77) Position 1 = 52, Position 2 = 250
Branch analysis from position: 52
2 jumps found. (Code = 78) Position 1 = 53, Position 2 = 250
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 68
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 66
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 46) Position 1 = 70, Position 2 = 71
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 85
Branch analysis from position: 72
2 jumps found. (Code = 77) Position 1 = 73, Position 2 = 84
Branch analysis from position: 73
2 jumps found. (Code = 78) Position 1 = 74, Position 2 = 84
Branch analysis from position: 74
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 80
Branch analysis from position: 77
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 80
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 84
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 158
Branch analysis from position: 87
2 jumps found. (Code = 47) Position 1 = 93, Position 2 = 102
Branch analysis from position: 93
2 jumps found. (Code = 43) Position 1 = 103, Position 2 = 116
Branch analysis from position: 103
2 jumps found. (Code = 43) Position 1 = 106, Position 2 = 109
Branch analysis from position: 106
1 jumps found. (Code = 42) Position 1 = 157
Branch analysis from position: 157
1 jumps found. (Code = 42) Position 1 = 249
Branch analysis from position: 249
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 109
Branch analysis from position: 116
2 jumps found. (Code = 43) Position 1 = 119, Position 2 = 130
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 149
Branch analysis from position: 149
1 jumps found. (Code = 42) Position 1 = 249
Branch analysis from position: 249
Branch analysis from position: 130
2 jumps found. (Code = 43) Position 1 = 142, Position 2 = 149
Branch analysis from position: 142
1 jumps found. (Code = 42) Position 1 = 249
Branch analysis from position: 249
Branch analysis from position: 149
Branch analysis from position: 102
Branch analysis from position: 158
2 jumps found. (Code = 43) Position 1 = 160, Position 2 = 244
Branch analysis from position: 160
2 jumps found. (Code = 43) Position 1 = 163, Position 2 = 177
Branch analysis from position: 163
2 jumps found. (Code = 46) Position 1 = 171, Position 2 = 172
Branch analysis from position: 171
2 jumps found. (Code = 43) Position 1 = 173, Position 2 = 176
Branch analysis from position: 173
1 jumps found. (Code = 42) Position 1 = 243
Branch analysis from position: 243
1 jumps found. (Code = 42) Position 1 = 249
Branch analysis from position: 249
Branch analysis from position: 176
Branch analysis from position: 172
Branch analysis from position: 177
2 jumps found. (Code = 46) Position 1 = 180, Position 2 = 183
Branch analysis from position: 180
2 jumps found. (Code = 43) Position 1 = 184, Position 2 = 208
Branch analysis from position: 184
2 jumps found. (Code = 46) Position 1 = 192, Position 2 = 193
Branch analysis from position: 192
2 jumps found. (Code = 46) Position 1 = 194, Position 2 = 195
Branch analysis from position: 194
2 jumps found. (Code = 43) Position 1 = 196, Position 2 = 203
Branch analysis from position: 196
1 jumps found. (Code = 42) Position 1 = 243
Branch analysis from position: 243
Branch analysis from position: 203
Branch analysis from position: 195
Branch analysis from position: 193
Branch analysis from position: 208
2 jumps found. (Code = 46) Position 1 = 219, Position 2 = 220
Branch analysis from position: 219
2 jumps found. (Code = 43) Position 1 = 221, Position 2 = 239
Branch analysis from position: 221
2 jumps found. (Code = 43) Position 1 = 224, Position 2 = 231
Branch analysis from position: 224
2 jumps found. (Code = 43) Position 1 = 232, Position 2 = 239
Branch analysis from position: 232
1 jumps found. (Code = 42) Position 1 = 249
Branch analysis from position: 249
Branch analysis from position: 239
Branch analysis from position: 231
Branch analysis from position: 239
Branch analysis from position: 220
Branch analysis from position: 183
Branch analysis from position: 244
2 jumps found. (Code = 43) Position 1 = 246, Position 2 = 249
Branch analysis from position: 246
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 249
Branch analysis from position: 84
Branch analysis from position: 85
Branch analysis from position: 71
Branch analysis from position: 66
2 jumps found. (Code = 46) Position 1 = 70, Position 2 = 71
Branch analysis from position: 70
Branch analysis from position: 71
Branch analysis from position: 68
Branch analysis from position: 250
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 250
filename:       /in/mCAvK
function name:  xml2array
number of ops:  253
compiled vars:  !0 = $contents, !1 = $get_attributes, !2 = $priority, !3 = $parser, !4 = $xml_values, !5 = $xml_array, !6 = $parents, !7 = $opened_tags, !8 = $arr, !9 = $current, !10 = $repeated_tag_index, !11 = $data, !12 = $attributes, !13 = $value, !14 = $result, !15 = $attributes_data, !16 = $val, !17 = $attr, !18 = $type, !19 = $parent, !20 = $level, !21 = $tag, !22 = $last_item_index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      1
          2        RECV_INIT                                        !2      'tag'
    4     3        BOOL_NOT                                         ~23     !0
          4      > JMPZ                                                     ~23, ->6
    5     5    > > RETURN                                                   <array>
    8     6    >   INIT_FCALL                                               'function_exists'
          7        SEND_VAL                                                 'xml_parser_create'
          8        DO_ICALL                                         $24     
          9        BOOL_NOT                                         ~25     $24
         10      > JMPZ                                                     ~25, ->12
   10    11    > > RETURN                                                   <array>
   14    12    >   INIT_FCALL                                               'xml_parser_create'
         13        SEND_VAL                                                 ''
         14        DO_ICALL                                         $26     
         15        ASSIGN                                                   !3, $26
   15    16        INIT_FCALL                                               'xml_parser_set_option'
         17        SEND_VAR                                                 !3
         18        SEND_VAL                                                 2
         19        SEND_VAL                                                 'UTF-8'
         20        DO_ICALL                                                 
   16    21        INIT_FCALL                                               'xml_parser_set_option'
         22        SEND_VAR                                                 !3
         23        SEND_VAL                                                 1
         24        SEND_VAL                                                 0
         25        DO_ICALL                                                 
   17    26        INIT_FCALL                                               'xml_parser_set_option'
         27        SEND_VAR                                                 !3
         28        SEND_VAL                                                 4
         29        SEND_VAL                                                 1
         30        DO_ICALL                                                 
   18    31        INIT_FCALL                                               'xml_parse_into_struct'
         32        SEND_VAR                                                 !3
         33        INIT_FCALL                                               'trim'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $31     
         36        SEND_VAR                                                 $31
         37        SEND_REF                                                 !4
         38        DO_ICALL                                                 
   19    39        INIT_FCALL                                               'xml_parser_free'
         40        SEND_VAR                                                 !3
         41        DO_ICALL                                                 
   21    42        BOOL_NOT                                         ~34     !4
         43      > JMPZ                                                     ~34, ->45
   22    44    > > RETURN                                                   null
   26    45    >   ASSIGN                                                   !5, <array>
   27    46        ASSIGN                                                   !6, <array>
   28    47        ASSIGN                                                   !7, <array>
   29    48        ASSIGN                                                   !8, <array>
   31    49        ASSIGN_REF                                               !9, !5
   34    50        ASSIGN                                                   !10, <array>
   35    51      > FE_RESET_R                                       $41     !4, ->250
         52    > > FE_FETCH_R                                               $41, !11, ->250
   36    53    >   UNSET_CV                                                 !12
         54        UNSET_CV                                                 !13
   40    55        INIT_FCALL                                               'extract'
         56        SEND_REF                                                 !11
         57        DO_ICALL                                                 
   42    58        ASSIGN                                                   !14, <array>
   43    59        ASSIGN                                                   !15, <array>
   45    60        ISSET_ISEMPTY_CV                                         !13
         61      > JMPZ                                                     ~45, ->68
   46    62    >   IS_EQUAL                                                 !2, 'tag'
         63      > JMPZ                                                     ~46, ->66
   47    64    >   ASSIGN                                                   !14, !13
         65      > JMP                                                      ->68
   49    66    >   ASSIGN_DIM                                               !14, 'value'
         67        OP_DATA                                                  !13
   54    68    >   ISSET_ISEMPTY_CV                                 ~49     !12
         69      > JMPZ_EX                                          ~49     ~49, ->71
         70    >   BOOL                                             ~49     !1
         71    > > JMPZ                                                     ~49, ->85
   55    72    > > FE_RESET_R                                       $50     !12, ->84
         73    > > FE_FETCH_R                                       ~51     $50, !16, ->84
         74    >   ASSIGN                                                   !17, ~51
   56    75        IS_EQUAL                                                 !2, 'tag'
         76      > JMPZ                                                     ~53, ->80
   57    77    >   ASSIGN_DIM                                               !15, !17
         78        OP_DATA                                                  !16
         79      > JMP                                                      ->83
   59    80    >   FETCH_DIM_W                                      $55     !14, 'attr'
         81        ASSIGN_DIM                                               $55, !17
         82        OP_DATA                                                  !16
   55    83    > > JMP                                                      ->73
         84    >   FE_FREE                                                  $50
   65    85    >   IS_EQUAL                                                 !18, 'open'
         86      > JMPZ                                                     ~57, ->158
   66    87    >   SUB                                              ~58     !20, 1
         88        FETCH_DIM_W                                      $59     !19, ~58
         89        ASSIGN_REF                                               $59, !9
   67    90        TYPE_CHECK                                  128  ~61     !9
         91        BOOL_NOT                                         ~62     ~61
         92      > JMPNZ_EX                                         ~62     ~62, ->102
         93    >   INIT_FCALL                                               'in_array'
         94        SEND_VAR                                                 !21
         95        INIT_FCALL                                               'array_keys'
         96        SEND_VAR                                                 !9
         97        DO_ICALL                                         $63     
         98        SEND_VAR                                                 $63
         99        DO_ICALL                                         $64     
        100        BOOL_NOT                                         ~65     $64
        101        BOOL                                             ~62     ~65
        102    > > JMPZ                                                     ~62, ->116
   68   103    >   ASSIGN_DIM                                               !9, !21
        104        OP_DATA                                                  !14
   69   105      > JMPZ                                                     !15, ->109
   70   106    >   CONCAT                                           ~67     !21, '_attr'
        107        ASSIGN_DIM                                               !9, ~67
        108        OP_DATA                                                  !15
   72   109    >   CONCAT                                           ~69     !21, '_'
        110        CONCAT                                           ~70     ~69, !20
        111        ASSIGN_DIM                                               !10, ~70
        112        OP_DATA                                                  1
   74   113        FETCH_DIM_W                                      $72     !9, !21
        114        ASSIGN_REF                                               !9, $72
        115      > JMP                                                      ->157
   78   116    >   FETCH_DIM_IS                                     ~74     !9, !21
        117        ISSET_ISEMPTY_DIM_OBJ                         0          ~74, 0
        118      > JMPZ                                                     ~75, ->130
   79   119    >   CONCAT                                           ~77     !21, '_'
        120        CONCAT                                           ~78     ~77, !20
        121        FETCH_DIM_R                                      ~79     !10, ~78
        122        FETCH_DIM_W                                      $76     !9, !21
        123        ASSIGN_DIM                                               $76, ~79
        124        OP_DATA                                                  !14
   80   125        CONCAT                                           ~81     !21, '_'
        126        CONCAT                                           ~82     ~81, !20
        127        FETCH_DIM_RW                                     $83     !10, ~82
        128        PRE_INC                                                  $83
        129      > JMP                                                      ->149
   82   130    >   FETCH_DIM_R                                      ~86     !9, !21
        131        INIT_ARRAY                                       ~87     ~86
        132        ADD_ARRAY_ELEMENT                                ~87     !14
        133        ASSIGN_DIM                                               !9, !21
        134        OP_DATA                                                  ~87
   83   135        CONCAT                                           ~88     !21, '_'
        136        CONCAT                                           ~89     ~88, !20
        137        ASSIGN_DIM                                               !10, ~89
        138        OP_DATA                                                  2
   85   139        CONCAT                                           ~91     !21, '_attr'
        140        ISSET_ISEMPTY_DIM_OBJ                         0          !9, ~91
        141      > JMPZ                                                     ~92, ->149
   86   142    >   CONCAT                                           ~95     !21, '_attr'
        143        FETCH_DIM_R                                      ~96     !9, ~95
        144        FETCH_DIM_W                                      $93     !9, !21
        145        ASSIGN_DIM                                               $93, '0_attr'
        146        OP_DATA                                                  ~96
   87   147        CONCAT                                           ~97     !21, '_attr'
        148        UNSET_DIM                                                !9, ~97
   91   149    >   CONCAT                                           ~98     !21, '_'
        150        CONCAT                                           ~99     ~98, !20
        151        FETCH_DIM_R                                      ~100    !10, ~99
        152        SUB                                              ~101    ~100, 1
        153        ASSIGN                                                   !22, ~101
   92   154        FETCH_DIM_W                                      $103    !9, !21
        155        FETCH_DIM_W                                      $104    $103, !22
        156        ASSIGN_REF                                               !9, $104
        157    > > JMP                                                      ->249
   95   158    >   IS_EQUAL                                                 !18, 'complete'
        159      > JMPZ                                                     ~106, ->244
   97   160    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~107    !9, !21
        161        BOOL_NOT                                         ~108    ~107
        162      > JMPZ                                                     ~108, ->177
   98   163    >   ASSIGN_DIM                                               !9, !21
        164        OP_DATA                                                  !14
   99   165        CONCAT                                           ~110    !21, '_'
        166        CONCAT                                           ~111    ~110, !20
        167        ASSIGN_DIM                                               !10, ~111
        168        OP_DATA                                                  1
  100   169        IS_EQUAL                                         ~113    !2, 'tag'
        170      > JMPZ_EX                                          ~113    ~113, ->172
        171    >   BOOL                                             ~113    !15
        172    > > JMPZ                                                     ~113, ->176
  101   173    >   CONCAT                                           ~114    !21, '_attr'
        174        ASSIGN_DIM                                               !9, ~114
        175        OP_DATA                                                  !15
        176    > > JMP                                                      ->243
  105   177    >   FETCH_DIM_IS                                     ~116    !9, !21
        178        ISSET_ISEMPTY_DIM_OBJ                         0  ~117    ~116, 0
        179      > JMPZ_EX                                          ~117    ~117, ->183
        180    >   FETCH_DIM_R                                      ~118    !9, !21
        181        TYPE_CHECK                                  128  ~119    ~118
        182        BOOL                                             ~117    ~119
        183    > > JMPZ                                                     ~117, ->208
  108   184    >   CONCAT                                           ~121    !21, '_'
        185        CONCAT                                           ~122    ~121, !20
        186        FETCH_DIM_R                                      ~123    !10, ~122
        187        FETCH_DIM_W                                      $120    !9, !21
        188        ASSIGN_DIM                                               $120, ~123
        189        OP_DATA                                                  !14
  110   190        IS_EQUAL                                         ~125    !2, 'tag'
        191      > JMPZ_EX                                          ~125    ~125, ->193
        192    >   BOOL                                             ~125    !1
        193    > > JMPZ_EX                                          ~125    ~125, ->195
        194    >   BOOL                                             ~125    !15
        195    > > JMPZ                                                     ~125, ->203
  111   196    >   CONCAT                                           ~127    !21, '_'
        197        CONCAT                                           ~128    ~127, !20
        198        FETCH_DIM_R                                      ~129    !10, ~128
        199        CONCAT                                           ~130    ~129, '_attr'
        200        FETCH_DIM_W                                      $126    !9, !21
        201        ASSIGN_DIM                                               $126, ~130
        202        OP_DATA                                                  !15
  113   203    >   CONCAT                                           ~132    !21, '_'
        204        CONCAT                                           ~133    ~132, !20
        205        FETCH_DIM_RW                                     $134    !10, ~133
        206        PRE_INC                                                  $134
        207      > JMP                                                      ->243
  116   208    >   FETCH_DIM_R                                      ~137    !9, !21
        209        INIT_ARRAY                                       ~138    ~137
        210        ADD_ARRAY_ELEMENT                                ~138    !14
        211        ASSIGN_DIM                                               !9, !21
        212        OP_DATA                                                  ~138
  117   213        CONCAT                                           ~139    !21, '_'
        214        CONCAT                                           ~140    ~139, !20
        215        ASSIGN_DIM                                               !10, ~140
        216        OP_DATA                                                  1
  118   217        IS_EQUAL                                         ~142    !2, 'tag'
        218      > JMPZ_EX                                          ~142    ~142, ->220
        219    >   BOOL                                             ~142    !1
        220    > > JMPZ                                                     ~142, ->239
  119   221    >   CONCAT                                           ~143    !21, '_attr'
        222        ISSET_ISEMPTY_DIM_OBJ                         0          !9, ~143
        223      > JMPZ                                                     ~144, ->231
  120   224    >   CONCAT                                           ~147    !21, '_attr'
        225        FETCH_DIM_R                                      ~148    !9, ~147
        226        FETCH_DIM_W                                      $145    !9, !21
        227        ASSIGN_DIM                                               $145, '0_attr'
        228        OP_DATA                                                  ~148
  121   229        CONCAT                                           ~149    !21, '_attr'
        230        UNSET_DIM                                                !9, ~149
  124   231    > > JMPZ                                                     !15, ->239
  125   232    >   CONCAT                                           ~151    !21, '_'
        233        CONCAT                                           ~152    ~151, !20
        234        FETCH_DIM_R                                      ~153    !10, ~152
        235        CONCAT                                           ~154    ~153, '_attr'
        236        FETCH_DIM_W                                      $150    !9, !21
        237        ASSIGN_DIM                                               $150, ~154
        238        OP_DATA                                                  !15
  128   239    >   CONCAT                                           ~156    !21, '_'
        240        CONCAT                                           ~157    ~156, !20
        241        FETCH_DIM_RW                                     $158    !10, ~157
        242        PRE_INC                                                  $158
        243    > > JMP                                                      ->249
  132   244    >   IS_EQUAL                                                 !18, 'close'
        245      > JMPZ                                                     ~160, ->249
  133   246    >   SUB                                              ~161    !20, 1
        247        FETCH_DIM_W                                      $162    !19, ~161
        248        ASSIGN_REF                                               !9, $162
   35   249    > > JMP                                                      ->52
        250    >   FE_FREE                                                  $41
  137   251      > RETURN                                                   !5
  138   252*     > RETURN                                                   null

End of function xml2array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
355.11 ms | 1426 KiB | 35 Q