3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = '<h1>Foo</h1><h2>Bar</h2><p>lorem ipsum</p>'; $dom = new \DomDocument(); $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED); $nodes = $dom->getElementsByTagName('*'); echo $nodes->item(0)->tagName . ' -> ' . $nodes->item(0)->nodeValue . "\n"; foreach ($nodes as $node) { echo $node->tagName . ' -> ' . $node->nodeValue . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/SFlNo
function name:  (null)
number of ops:  35
compiled vars:  !0 = $html, !1 = $dom, !2 = $nodes, !3 = $node
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Ch1%3EFoo%3C%2Fh1%3E%3Ch2%3EBar%3C%2Fh2%3E%3Cp%3Elorem+ipsum%3C%2Fp%3E'
    4     1        NEW                                                  $5      'DomDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $5
    5     4        INIT_METHOD_CALL                                             !1, 'loadHTML'
          5        SEND_VAR_EX                                                  !0
          6        SEND_VAL_EX                                                  8192
          7        DO_FCALL                                          0          
    6     8        INIT_METHOD_CALL                                             !1, 'getElementsByTagName'
          9        SEND_VAL_EX                                                  '%2A'
         10        DO_FCALL                                          0  $9      
         11        ASSIGN                                                       !2, $9
    7    12        INIT_METHOD_CALL                                             !2, 'item'
         13        SEND_VAL_EX                                                  0
         14        DO_FCALL                                          0  $11     
         15        FETCH_OBJ_R                                          ~12     $11, 'tagName'
         16        CONCAT                                               ~13     ~12, '+-%3E+'
         17        INIT_METHOD_CALL                                             !2, 'item'
         18        SEND_VAL_EX                                                  0
         19        DO_FCALL                                          0  $14     
         20        FETCH_OBJ_R                                          ~15     $14, 'nodeValue'
         21        CONCAT                                               ~16     ~13, ~15
         22        CONCAT                                               ~17     ~16, '%0A'
         23        ECHO                                                         ~17
    8    24      > FE_RESET_R                                           $18     !2, ->33
         25    > > FE_FETCH_R                                                   $18, !3, ->33
    9    26    >   FETCH_OBJ_R                                          ~19     !3, 'tagName'
         27        CONCAT                                               ~20     ~19, '+-%3E+'
         28        FETCH_OBJ_R                                          ~21     !3, 'nodeValue'
         29        CONCAT                                               ~22     ~20, ~21
         30        CONCAT                                               ~23     ~22, '%0A'
         31        ECHO                                                         ~23
    8    32      > JMP                                                          ->25
         33    >   FE_FREE                                                      $18
   10    34      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
216.02 ms | 2748 KiB | 8 Q