3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <root> <item id="images"> <images handle="kings-of-leon_poster_v02_webjpg" path="workspace/assets/uploads/" type="file">kings of leon_poster_v02_WEB.jpg</images> </item> <item id="about"> <page-name handle="new-age" type="page-name">New Age</page-name> </item> <item id="about"> <page-name handle="new-age-2" type="page-name">New Age 2</page-name> </item> <item id="images"> <images handle="aae_seating-plan_v01jpg" path="workspace/assets/uploads/" type="file">AAE_Seating-plan_v01.jpg</images> </item> <item id="images"> <images handle="evidence-of-communication-between-myself-and-external-sourcespng" path="workspace/assets/uploads/" type="file">evidence-of-communication-between-myself-and-external-sources.png</images> </item> </root> '; $dom = new DOMDocument; $dom->loadXML($xml); //var_dump($dom); $xpath = new DOMXPath($dom); $res1 = $xpath->query('//root/item[@id="images"]/descendant::*[./@handle = "kings-of-leon_poster_v02_webjpg"]'); vr_dump($res1->item); foreach($res1 as $res){ var_dump($res); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/kYSdS
function name:  (null)
number of ops:  28
compiled vars:  !0 = $xml, !1 = $dom, !2 = $xpath, !3 = $res1, !4 = $res
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%3Croot%3E%0A++++++++%3Citem+id%3D%22images%22%3E%0A+++++++++%3Cimages+handle%3D%22kings-of-leon_poster_v02_webjpg%22+path%3D%22workspace%2Fassets%2Fuploads%2F%22+type%3D%22file%22%3Ekings+of+leon_poster_v02_WEB.jpg%3C%2Fimages%3E%0A++++++++%3C%2Fitem%3E%0A++++++++%3Citem+id%3D%22about%22%3E%0A+++++++++%3Cpage-name+handle%3D%22new-age%22+type%3D%22page-name%22%3ENew+Age%3C%2Fpage-name%3E%0A++++++++%3C%2Fitem%3E%0A++++++++%3Citem+id%3D%22about%22%3E%0A+++++++++%3Cpage-name+handle%3D%22new-age-2%22+type%3D%22page-name%22%3ENew+Age+2%3C%2Fpage-name%3E%0A++++++++%3C%2Fitem%3E%0A++++++++%3Citem+id%3D%22images%22%3E%0A+++++++++%3Cimages+handle%3D%22aae_seating-plan_v01jpg%22+path%3D%22workspace%2Fassets%2Fuploads%2F%22+type%3D%22file%22%3EAAE_Seating-plan_v01.jpg%3C%2Fimages%3E%0A++++++++%3C%2Fitem%3E%0A++++++++%3Citem+id%3D%22images%22%3E%0A+++++++++%3Cimages+handle%3D%22evidence-of-communication-between-myself-and-external-sourcespng%22+path%3D%22workspace%2Fassets%2Fuploads%2F%22+type%3D%22file%22%3Eevidence-of-communication-between-myself-and-external-sources.png%3C%2Fimages%3E%0A++++++++%3C%2Fitem%3E%0A%3C%2Froot%3E%0A'
   24     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   25     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   27     7        NEW                                              $10     'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $10
   29    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Froot%2Fitem%5B%40id%3D%22images%22%5D%2Fdescendant%3A%3A%2A%5B.%2F%40handle+%3D+%22kings-of-leon_poster_v02_webjpg%22%5D'
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !3, $13
   30    15        INIT_FCALL_BY_NAME                                       'vr_dump'
         16        CHECK_FUNC_ARG                                           
         17        FETCH_OBJ_FUNC_ARG                               $15     !3, 'item'
         18        SEND_FUNC_ARG                                            $15
         19        DO_FCALL                                      0          
   31    20      > FE_RESET_R                                       $17     !3, ->26
         21    > > FE_FETCH_R                                               $17, !4, ->26
   32    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
   31    25      > JMP                                                      ->21
         26    >   FE_FREE                                                  $17
   37    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.33 ms | 1400 KiB | 15 Q