3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<EOT <html> <body> <img src="img1.jpg" /> <img src="img2.jpg" /> <a href="#"> link 1</a> <a href="page.HTML">link 2</a> </body> </html> EOT; $d = new DOMDocument(); $d->loadHTML($str); $sx = simplexml_import_dom($d); foreach ($sx->xpath('') as $v) { echo $v->getName() . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/jdcs8
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $d, !2 = $sx, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%0A%3Cbody%3E%0A%3Cimg+src%3D%22img1.jpg%22+%2F%3E%0A%3Cimg+src%3D%22img2.jpg%22+%2F%3E%0A%3Ca+href%3D%22%23%22%3E+link+1%3C%2Fa%3E%0A%3Ca+href%3D%22page.HTML%22%3Elink+2%3C%2Fa%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   16     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   17     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   19     7        INIT_FCALL                                               'simplexml_import_dom'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !2, $9
   20    11        INIT_METHOD_CALL                                         !2, 'xpath'
         12        SEND_VAL_EX                                              ''
         13        DO_FCALL                                      0  $11     
         14      > FE_RESET_R                                       $12     $11, ->21
         15    > > FE_FETCH_R                                               $12, !3, ->21
   21    16    >   INIT_METHOD_CALL                                         !3, 'getName'
         17        DO_FCALL                                      0  $13     
         18        CONCAT                                           ~14     $13, '%0A'
         19        ECHO                                                     ~14
   20    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $12
   22    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.76 ms | 1395 KiB | 15 Q