3v4l.org

run code in 300+ PHP versions simultaneously
<?php $root = new DOMDocument(); $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 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 8
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 8
Branch analysis from position: 50
Branch analysis from position: 8
filename:       /in/bS1o7
function name:  (null)
number of ops:  54
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        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              '%3Carticle+id%3D%22%22%3E%3C%2Farticle%3E'
          5        DO_FCALL                                      0          
    5     6        ASSIGN                                                   !1, 0
          7      > JMP                                                      ->48
    6     8    >   NEW                                              $11     'DOMDocument'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $11
    7    11        INIT_METHOD_CALL                                         !2, 'loadXML'
         12        CONCAT                                           ~14     '%3Csection+id%3D%22', !1
         13        CONCAT                                           ~15     ~14, '%22%3E%3Ch1%3E%C3%9Cberschrift%3C%2Fh1%3E%3Ch2%3E%C3%9Cberschrift2%3C%2Fh2%3E%3Cp%3EContent%3C%2Fp%3E%3C%2Fsection%3E'
         14        SEND_VAL_EX                                              ~15
         15        DO_FCALL                                      0          
    8    16        NEW                                              $17     'DOMXPath'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !3, $17
    9    20        ASSIGN                                                   !4, '%2F%2Fh1'
   10    21        INIT_METHOD_CALL                                         !3, 'query'
         22        SEND_VAR_EX                                              !4
         23        DO_FCALL                                      0  $21     
         24        ASSIGN                                                   !5, $21
   12    25        INIT_METHOD_CALL                                         !5, 'item'
         26        SEND_VAL_EX                                              0
         27        DO_FCALL                                      0  $23     
         28        INIT_METHOD_CALL                                         $23, 'appendChild'
         29        INIT_METHOD_CALL                                         !2, 'createTextNode'
         30        CONCAT                                           ~24     'Text+', !1
         31        CONCAT                                           ~25     ~24, '+'
         32        SEND_VAL_EX                                              ~25
         33        DO_FCALL                                      0  $26     
         34        SEND_VAR_NO_REF_EX                                       $26
         35        DO_FCALL                                      0          
   15    36        INIT_METHOD_CALL                                         !0, 'importNode'
         37        CHECK_FUNC_ARG                                           
         38        FETCH_OBJ_FUNC_ARG                               $28     !2, 'documentElement'
         39        SEND_FUNC_ARG                                            $28
         40        SEND_VAL_EX                                              <true>
         41        DO_FCALL                                      0  $29     
         42        ASSIGN                                                   !2, $29
   16    43        FETCH_OBJ_R                                      ~31     !0, 'documentElement'
         44        INIT_METHOD_CALL                                         ~31, 'appendChild'
         45        SEND_VAR_EX                                              !2
         46        DO_FCALL                                      0          
    5    47        PRE_INC                                                  !1
         48    >   IS_SMALLER_OR_EQUAL                                      !1, 300
         49      > JMPNZ                                                    ~34, ->8
   18    50    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         51        DO_FCALL                                      0  $35     
         52        ECHO                                                     $35
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.88 ms | 1390 KiB | 13 Q