3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.88 ms | 1395 KiB | 13 Q