3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<html><body><a href="/page?param=1&amp;param=2">Text.</a></body></html>'; $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXpath($dom); foreach($xpath->query('//a/@href') as $node) { var_dump($node->value); }
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/19Yjs
function name:  (null)
number of ops:  23
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%3Cbody%3E%3Ca+href%3D%22%2Fpage%3Fparam%3D1%26amp%3Bparam%3D2%22%3EText.%3C%2Fa%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
    5     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    6     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    7     7        NEW                                              $9      'DOMXpath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
    8    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, ->21
         15    > > FE_FETCH_R                                               $13, !3, ->21
   10    16    >   INIT_FCALL                                               'var_dump'
         17        FETCH_OBJ_R                                      ~14     !3, 'value'
         18        SEND_VAL                                                 ~14
         19        DO_ICALL                                                 
    8    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $13
   11    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.57 ms | 998 KiB | 14 Q