3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <xml> <a href="site.com/3572">bla-bla-bla1</a> <a href="site.com/asfsagf">bla-bla-bla2</a> <a href="site.com/347548">bla-bla-bla3</a> </xml> XML; $dom = new DOMDocument; $dom->loadXML($xml); $xpath = new DOMXPath($dom); foreach ($xpath->query('//a/@href') as $href) { echo $href->nodeValue, PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/0XlvA
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xml, !1 = $dom, !2 = $xpath, !3 = $href
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cxml%3E%0A%09%3Ca+href%3D%22site.com%2F3572%22%3Ebla-bla-bla1%3C%2Fa%3E%0A%09%3Ca+href%3D%22site.com%2Fasfsagf%22%3Ebla-bla-bla2%3C%2Fa%3E%0A%09%3Ca+href%3D%22site.com%2F347548%22%3Ebla-bla-bla3%3C%2Fa%3E%0A%3C%2Fxml%3E'
   11     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   12     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   14     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
   15    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fa%2F%40href'
         13        DO_FCALL                                      0  $12     
         14      > FE_RESET_R                                       $13     $12, ->20
         15    > > FE_FETCH_R                                               $13, !3, ->20
   16    16    >   FETCH_OBJ_R                                      ~14     !3, 'nodeValue'
         17        ECHO                                                     ~14
         18        ECHO                                                     '%0A'
   15    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $13
   17    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.46 ms | 1394 KiB | 13 Q