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); var_dump($xp->evaluate('//li/text()')->item(1)->textContent);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s2tcJ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $html, !1 = $dom, !2 = $xp
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                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   13     4        INIT_METHOD_CALL                                         !1, 'loadHtml'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   14     7        NEW                                              $8      'DOMXpath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $8
   16    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !2, 'evaluate'
         13        SEND_VAL_EX                                              '%2F%2Fli%2Ftext%28%29'
         14        DO_FCALL                                      0  $11     
         15        INIT_METHOD_CALL                                         $11, 'item'
         16        SEND_VAL_EX                                              1
         17        DO_FCALL                                      0  $12     
         18        FETCH_OBJ_R                                      ~13     $12, 'textContent'
         19        SEND_VAL                                                 ~13
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.54 ms | 997 KiB | 14 Q