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->documentElement->appendChild($f); $nodes = $f->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 = 30, Position 2 = 38
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/erYb7
function name:  (null)
number of ops:  40
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        FETCH_OBJ_R                                      ~10     !0, 'documentElement'
         10        INIT_METHOD_CALL                                         ~10, 'appendChild'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
    6    13        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         14        SEND_VAL_EX                                              '%2A'
         15        DO_FCALL                                      0  $12     
         16        ASSIGN                                                   !2, $12
    7    17        INIT_METHOD_CALL                                         !2, 'item'
         18        SEND_VAL_EX                                              0
         19        DO_FCALL                                      0  $14     
         20        FETCH_OBJ_R                                      ~15     $14, 'tagName'
         21        CONCAT                                           ~16     ~15, '+-%3E+'
         22        INIT_METHOD_CALL                                         !2, 'item'
         23        SEND_VAL_EX                                              0
         24        DO_FCALL                                      0  $17     
         25        FETCH_OBJ_R                                      ~18     $17, 'nodeValue'
         26        CONCAT                                           ~19     ~16, ~18
         27        CONCAT                                           ~20     ~19, '%3Cbr%2F%3E'
         28        ECHO                                                     ~20
    8    29      > FE_RESET_R                                       $21     !2, ->38
         30    > > FE_FETCH_R                                               $21, !3, ->38
    9    31    >   FETCH_OBJ_R                                      ~22     !3, 'tagName'
         32        CONCAT                                           ~23     ~22, '+-%3E+'
         33        FETCH_OBJ_R                                      ~24     !3, 'nodeValue'
         34        CONCAT                                           ~25     ~23, ~24
         35        CONCAT                                           ~26     ~25, '%3Cbr%2F%3E'
         36        ECHO                                                     ~26
    8    37      > JMP                                                      ->30
         38    >   FE_FREE                                                  $21
   10    39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.69 ms | 1399 KiB | 13 Q