3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<lib id="ITEM_I_WANT_TO_DOWNLOAD_1" revision="0000"> <part id="0000" type="ch"/> <part id="0000" type="ls"/> <part id="0000" type="rs"/> <part id="0000" type="ch"/> </lib> <lib id="ITEM_I_WANT_TO_DOWNLOAD_2" revision="0000"> <part id="0000" type="ch"/> <part id="0000" type="ls"/> <part id="0000" type="rs"/> <part id="0000" type="ch"/> </lib>'; $xml = '<?xml version="1.0"?>' . $xml . '</xml>'; // repair invalid xml https://stackoverflow.com/q/4544272/2943403 $doc = new DOMDocument(); $doc->loadXml($xml); $xpath = new DOMXpath($doc); foreach ($xpath->evaluate('//lib/@id') as $attr) { $result[] = $attr->value; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/NEA7p
function name:  (null)
number of ops:  28
compiled vars:  !0 = $xml, !1 = $doc, !2 = $xpath, !3 = $attr, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Clib+id%3D%22ITEM_I_WANT_TO_DOWNLOAD_1%22+revision%3D%220000%22%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22ch%22%2F%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22ls%22%2F%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22rs%22%2F%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22ch%22%2F%3E%0A++%3C%2Flib%3E%0A%3Clib+id%3D%22ITEM_I_WANT_TO_DOWNLOAD_2%22+revision%3D%220000%22%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22ch%22%2F%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22ls%22%2F%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22rs%22%2F%3E%0A++++%3Cpart+id%3D%220000%22+type%3D%22ch%22%2F%3E%0A++%3C%2Flib%3E'
   15     1        CONCAT                                           ~6      '%3C%3Fxml+version%3D%221.0%22%3F%3E', !0
          2        CONCAT                                           ~7      ~6, '%3C%2Fxml%3E'
          3        ASSIGN                                                   !0, ~7
   18     4        NEW                                              $9      'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $9
   19     7        INIT_METHOD_CALL                                         !1, 'loadXml'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   20    10        NEW                                              $13     'DOMXpath'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $13
   21    14        INIT_METHOD_CALL                                         !2, 'evaluate'
         15        SEND_VAL_EX                                              '%2F%2Flib%2F%40id'
         16        DO_FCALL                                      0  $16     
         17      > FE_RESET_R                                       $17     $16, ->23
         18    > > FE_FETCH_R                                               $17, !3, ->23
   22    19    >   FETCH_OBJ_R                                      ~19     !3, 'value'
         20        ASSIGN_DIM                                               !4
         21        OP_DATA                                                  ~19
   21    22      > JMP                                                      ->18
         23    >   FE_FREE                                                  $17
   24    24        INIT_FCALL                                               'var_export'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.57 ms | 1396 KiB | 15 Q