3v4l.org

run code in 300+ PHP versions simultaneously
<?php $root = new DOMDocument(); $root->formatOutput = true; $root->loadXML('<article id=""></article>'); for($i=0;$i<=300;$i++){ $node = new DOMDocument(); $node->loadXML('<section id="'.$i.'"><h1>Überschrift</h1><h2>Überschrift2</h2><p>Content</p></section>'); $xpath = new DOMXPath($node); $query = '//h1'; $entries=$xpath->query($query); $entries->item(0)->nodeValue = ""; $entries->item(0)->appendChild($node->createTextNode("Text ".$i)); $node = $root->importNode($node->documentElement, true); $root->documentElement->appendChild($node); } print $root->saveXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 10
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 10
Branch analysis from position: 57
Branch analysis from position: 10
filename:       /in/8jXUo
function name:  (null)
number of ops:  61
compiled vars:  !0 = $root, !1 = $i, !2 = $node, !3 = $xpath, !4 = $query, !5 = $entries
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    4     3        ASSIGN_OBJ                                               !0, 'formatOutput'
          4        OP_DATA                                                  <true>
    5     5        INIT_METHOD_CALL                                         !0, 'loadXML'
          6        SEND_VAL_EX                                              '%3Carticle+id%3D%22%22%3E%3C%2Farticle%3E'
          7        DO_FCALL                                      0          
    6     8        ASSIGN                                                   !1, 0
          9      > JMP                                                      ->55
    7    10    >   NEW                                              $12     'DOMDocument'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $12
    8    13        INIT_METHOD_CALL                                         !2, 'loadXML'
         14        CONCAT                                           ~15     '%3Csection+id%3D%22', !1
         15        CONCAT                                           ~16     ~15, '%22%3E%3Ch1%3E%C3%9Cberschrift%3C%2Fh1%3E%3Ch2%3E%C3%9Cberschrift2%3C%2Fh2%3E%3Cp%3EContent%3C%2Fp%3E%3C%2Fsection%3E'
         16        SEND_VAL_EX                                              ~16
         17        DO_FCALL                                      0          
    9    18        NEW                                              $18     'DOMXPath'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !3, $18
   10    22        ASSIGN                                                   !4, '%2F%2Fh1'
   11    23        INIT_METHOD_CALL                                         !3, 'query'
         24        SEND_VAR_EX                                              !4
         25        DO_FCALL                                      0  $22     
         26        ASSIGN                                                   !5, $22
   12    27        INIT_METHOD_CALL                                         !5, 'item'
         28        SEND_VAL_EX                                              0
         29        DO_FCALL                                      0  $24     
         30        SEPARATE                                         $24     $24
         31        ASSIGN_OBJ                                               $24, 'nodeValue'
         32        OP_DATA                                                  ''
   13    33        INIT_METHOD_CALL                                         !5, 'item'
         34        SEND_VAL_EX                                              0
         35        DO_FCALL                                      0  $26     
         36        INIT_METHOD_CALL                                         $26, 'appendChild'
         37        INIT_METHOD_CALL                                         !2, 'createTextNode'
         38        CONCAT                                           ~27     'Text+', !1
         39        SEND_VAL_EX                                              ~27
         40        DO_FCALL                                      0  $28     
         41        SEND_VAR_NO_REF_EX                                       $28
         42        DO_FCALL                                      0          
   16    43        INIT_METHOD_CALL                                         !0, 'importNode'
         44        CHECK_FUNC_ARG                                           
         45        FETCH_OBJ_FUNC_ARG                               $30     !2, 'documentElement'
         46        SEND_FUNC_ARG                                            $30
         47        SEND_VAL_EX                                              <true>
         48        DO_FCALL                                      0  $31     
         49        ASSIGN                                                   !2, $31
   17    50        FETCH_OBJ_R                                      ~33     !0, 'documentElement'
         51        INIT_METHOD_CALL                                         ~33, 'appendChild'
         52        SEND_VAR_EX                                              !2
         53        DO_FCALL                                      0          
    6    54        PRE_INC                                                  !1
         55    >   IS_SMALLER_OR_EQUAL                                      !1, 300
         56      > JMPNZ                                                    ~36, ->10
   19    57    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         58        DO_FCALL                                      0  $37     
         59        ECHO                                                     $37
         60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.06 ms | 944 KiB | 14 Q