3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<li><a href="#" title="something something">test</a></li>'; $html .= '<li><a href="#" title="something something2">test2</a></li>'; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $lis = $xpath->query("*/li/a[@title='something something']"); foreach ($lis as $li) { var_dump($li->nodeValue); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/n5Iqk
function name:  (null)
number of ops:  25
compiled vars:  !0 = $html, !1 = $doc, !2 = $xpath, !3 = $lis, !4 = $li
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cli%3E%3Ca+href%3D%22%23%22+title%3D%22something+something%22%3Etest%3C%2Fa%3E%3C%2Fli%3E'
    4     1        ASSIGN_OP                                     8          !0, '%3Cli%3E%3Ca+href%3D%22%23%22+title%3D%22something+something2%22%3Etest2%3C%2Fa%3E%3C%2Fli%3E'
    5     2        NEW                                              $7      'DOMDocument'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
    6     5        INIT_METHOD_CALL                                         !1, 'loadHTML'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
    7     8        NEW                                              $11     'DOMXPath'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
    8    12        INIT_METHOD_CALL                                         !2, 'query'
         13        SEND_VAL_EX                                              '%2A%2Fli%2Fa%5B%40title%3D%27something+something%27%5D'
         14        DO_FCALL                                      0  $14     
         15        ASSIGN                                                   !3, $14
    9    16      > FE_RESET_R                                       $16     !3, ->23
         17    > > FE_FETCH_R                                               $16, !4, ->23
   10    18    >   INIT_FCALL                                               'var_dump'
         19        FETCH_OBJ_R                                      ~17     !4, 'nodeValue'
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                                 
    9    22      > JMP                                                      ->17
         23    >   FE_FREE                                                  $16
   11    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.45 ms | 1003 KiB | 14 Q