3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <a href="http://aaa.com">http://aaa.com</a> HTML; $dom = new DomDocument(); $dom->loadHTML($html); foreach ($dom->getElementsByTagName('a') as $link) { var_dump($link->getAttribute('href')); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/4vEif
function name:  (null)
number of ops:  21
compiled vars:  !0 = $html, !1 = $dom, !2 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ca+href%3D%22http%3A%2F%2Faaa.com%22%3Ehttp%3A%2F%2Faaa.com%3C%2Fa%3E'
    7     1        NEW                                              $4      'DomDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    8     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   10     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'a'
          9        DO_FCALL                                      0  $8      
         10      > FE_RESET_R                                       $9      $8, ->19
         11    > > FE_FETCH_R                                               $9, !2, ->19
   11    12    >   INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !2, 'getAttribute'
         14        SEND_VAL_EX                                              'href'
         15        DO_FCALL                                      0  $10     
         16        SEND_VAR                                                 $10
         17        DO_ICALL                                                 
   10    18      > JMP                                                      ->11
         19    >   FE_FREE                                                  $9
   12    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.14 ms | 1395 KiB | 15 Q