3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<< HTML <div> <ul> <li></li> <li>Something <br/> Something</li> </ul> </div> HTML; $dom = new DOMDocument; $dom->loadHtml($html); $xp = new DOMXpath($dom); foreach ($xp->evaluate('//li/text()') as $li) { echo $li->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/KIDWM
function name:  (null)
number of ops:  22
compiled vars:  !0 = $html, !1 = $dom, !2 = $xp, !3 = $li
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cdiv%3E%0A+++%3Cul%3E%0A++++%3Cli%3E%3C%2Fli%3E%0A++++%3Cli%3ESomething+%3Cbr%2F%3E+Something%3C%2Fli%3E%0A++%3C%2Ful%3E%0A%3C%2Fdiv%3E'
   12     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   13     4        INIT_METHOD_CALL                                         !1, 'loadHtml'
          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
   16    11        INIT_METHOD_CALL                                         !2, 'evaluate'
         12        SEND_VAL_EX                                              '%2F%2Fli%2Ftext%28%29'
         13        DO_FCALL                                      0  $12     
         14      > FE_RESET_R                                       $13     $12, ->20
         15    > > FE_FETCH_R                                               $13, !3, ->20
   17    16    >   FETCH_OBJ_R                                      ~14     !3, 'nodeValue'
         17        ECHO                                                     ~14
         18        ECHO                                                     '%0A'
   16    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $13
   18    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.9 ms | 995 KiB | 13 Q