3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html=new DOMDocument(); $html->loadHTML('<div class="test">HALLO</div>'); $tags=$html->getElementsByTagName("div"); echo $tags[0]->tagName."<br />"; foreach ($tags[0]->attributes as $attr) { echo $attr->value."<br />"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/jlp6E
function name:  (null)
number of ops:  24
compiled vars:  !0 = $html, !1 = $tags, !2 = $attr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
          4        SEND_VAL_EX                                              '%3Cdiv+class%3D%22test%22%3EHALLO%3C%2Fdiv%3E'
          5        DO_FCALL                                      0          
    6     6        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          7        SEND_VAL_EX                                              'div'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
    8    10        FETCH_DIM_R                                      ~9      !1, 0
         11        FETCH_OBJ_R                                      ~10     ~9, 'tagName'
         12        CONCAT                                           ~11     ~10, '%3Cbr+%2F%3E'
         13        ECHO                                                     ~11
   10    14        FETCH_DIM_R                                      ~12     !1, 0
         15        FETCH_OBJ_R                                      ~13     ~12, 'attributes'
         16      > FE_RESET_R                                       $14     ~13, ->22
         17    > > FE_FETCH_R                                               $14, !2, ->22
   11    18    >   FETCH_OBJ_R                                      ~15     !2, 'value'
         19        CONCAT                                           ~16     ~15, '%3Cbr+%2F%3E'
         20        ECHO                                                     ~16
   10    21      > JMP                                                      ->17
         22    >   FE_FREE                                                  $14
   12    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.86 ms | 995 KiB | 13 Q