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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.89 ms | 1395 KiB | 13 Q