3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <releases> <track> <artist>salva</artist> <title>nome</title> <year>2015</year> <label>maxa</label> </track> <track> <artist>another test</artist> <title>tracks</title> <year>2022</year> <label>buru</label> </track> <track> <artist>re</artist> <title>de</title> <year>?</year> <label>df</label> </track> <track> <artist>yu</artist> <title>tube</title> <year>5</year> <label>fy</label> </track> </releases>'; $dom = new DOMDocument(); $dom->loadXML($xml); $releases = $dom->getElementsByTagName('releases')->item(0); $tracks = $releases->getElementsByTagName('track'); foreach ($tracks as $track) { $artist = $track->getElementsByTagName('artist')->item(0)->nodeValue; $title = $track->getElementsByTagName('title')->item(0)->nodeValue; $year = $track->getElementsByTagName('label')->item(0)->nodeValue; echo $artist.', '.$title.', '.$year."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 51
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 51
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
filename:       /in/RLK1U
function name:  (null)
number of ops:  53
compiled vars:  !0 = $xml, !1 = $dom, !2 = $releases, !3 = $tracks, !4 = $track, !5 = $artist, !6 = $title, !7 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Creleases%3E%0A%3Ctrack%3E%0A%3Cartist%3Esalva%3C%2Fartist%3E%0A%3Ctitle%3Enome%3C%2Ftitle%3E%0A%3Cyear%3E2015%3C%2Fyear%3E%0A%3Clabel%3Emaxa%3C%2Flabel%3E%0A%3C%2Ftrack%3E%0A%3Ctrack%3E%0A%3Cartist%3Eanother+test%3C%2Fartist%3E%0A%3Ctitle%3Etracks%3C%2Ftitle%3E%0A%3Cyear%3E2022%3C%2Fyear%3E%0A%3Clabel%3Eburu%3C%2Flabel%3E%0A%3C%2Ftrack%3E%0A%3Ctrack%3E%0A%3Cartist%3Ere%3C%2Fartist%3E%0A%3Ctitle%3Ede%3C%2Ftitle%3E%0A%3Cyear%3E%3F%3C%2Fyear%3E%0A%3Clabel%3Edf%3C%2Flabel%3E%0A%3C%2Ftrack%3E%0A%3Ctrack%3E%0A%3Cartist%3Eyu%3C%2Fartist%3E%0A%3Ctitle%3Etube%3C%2Ftitle%3E%0A%3Cyear%3E5%3C%2Fyear%3E%0A%3Clabel%3Efy%3C%2Flabel%3E%0A%3C%2Ftrack%3E%0A%3C%2Freleases%3E'
   34     1        NEW                                              $9      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $9
   35     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   37     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'releases'
          9        DO_FCALL                                      0  $13     
         10        INIT_METHOD_CALL                                         $13, 'item'
         11        SEND_VAL_EX                                              0
         12        DO_FCALL                                      0  $14     
         13        ASSIGN                                                   !2, $14
   38    14        INIT_METHOD_CALL                                         !2, 'getElementsByTagName'
         15        SEND_VAL_EX                                              'track'
         16        DO_FCALL                                      0  $16     
         17        ASSIGN                                                   !3, $16
   40    18      > FE_RESET_R                                       $18     !3, ->51
         19    > > FE_FETCH_R                                               $18, !4, ->51
   41    20    >   INIT_METHOD_CALL                                         !4, 'getElementsByTagName'
         21        SEND_VAL_EX                                              'artist'
         22        DO_FCALL                                      0  $19     
         23        INIT_METHOD_CALL                                         $19, 'item'
         24        SEND_VAL_EX                                              0
         25        DO_FCALL                                      0  $20     
         26        FETCH_OBJ_R                                      ~21     $20, 'nodeValue'
         27        ASSIGN                                                   !5, ~21
   42    28        INIT_METHOD_CALL                                         !4, 'getElementsByTagName'
         29        SEND_VAL_EX                                              'title'
         30        DO_FCALL                                      0  $23     
         31        INIT_METHOD_CALL                                         $23, 'item'
         32        SEND_VAL_EX                                              0
         33        DO_FCALL                                      0  $24     
         34        FETCH_OBJ_R                                      ~25     $24, 'nodeValue'
         35        ASSIGN                                                   !6, ~25
   43    36        INIT_METHOD_CALL                                         !4, 'getElementsByTagName'
         37        SEND_VAL_EX                                              'label'
         38        DO_FCALL                                      0  $27     
         39        INIT_METHOD_CALL                                         $27, 'item'
         40        SEND_VAL_EX                                              0
         41        DO_FCALL                                      0  $28     
         42        FETCH_OBJ_R                                      ~29     $28, 'nodeValue'
         43        ASSIGN                                                   !7, ~29
   44    44        CONCAT                                           ~31     !5, '%2C+'
         45        CONCAT                                           ~32     ~31, !6
         46        CONCAT                                           ~33     ~32, '%2C+'
         47        CONCAT                                           ~34     ~33, !7
         48        CONCAT                                           ~35     ~34, '%0A'
         49        ECHO                                                     ~35
   40    50      > JMP                                                      ->19
         51    >   FE_FREE                                                  $18
   45    52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
233.83 ms | 1002 KiB | 13 Q