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 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 8
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 8
Branch analysis from position: 56
Branch analysis from position: 8
filename:       /in/tMZrU
function name:  (null)
number of ops:  60
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                                                      ->54
    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
   11    25        INIT_METHOD_CALL                                         !5, 'item'
         26        SEND_VAL_EX                                              0
         27        DO_FCALL                                      0  $23     
         28        SEPARATE                                         $23     $23
         29        ASSIGN_OBJ                                               $23, 'nodeValue'
         30        OP_DATA                                                  ''
   12    31        INIT_METHOD_CALL                                         !5, 'item'
         32        SEND_VAL_EX                                              0
         33        DO_FCALL                                      0  $25     
         34        INIT_METHOD_CALL                                         $25, 'appendChild'
         35        INIT_METHOD_CALL                                         !2, 'createTextNode'
         36        CONCAT                                           ~26     'Text+', !1
         37        CONCAT                                           ~27     ~26, '+'
         38        SEND_VAL_EX                                              ~27
         39        DO_FCALL                                      0  $28     
         40        SEND_VAR_NO_REF_EX                                       $28
         41        DO_FCALL                                      0          
   15    42        INIT_METHOD_CALL                                         !0, 'importNode'
         43        CHECK_FUNC_ARG                                           
         44        FETCH_OBJ_FUNC_ARG                               $30     !2, 'documentElement'
         45        SEND_FUNC_ARG                                            $30
         46        SEND_VAL_EX                                              <true>
         47        DO_FCALL                                      0  $31     
         48        ASSIGN                                                   !2, $31
   16    49        FETCH_OBJ_R                                      ~33     !0, 'documentElement'
         50        INIT_METHOD_CALL                                         ~33, 'appendChild'
         51        SEND_VAR_EX                                              !2
         52        DO_FCALL                                      0          
    5    53        PRE_INC                                                  !1
         54    >   IS_SMALLER_OR_EQUAL                                      !1, 300
         55      > JMPNZ                                                    ~36, ->8
   18    56    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         57        DO_FCALL                                      0  $37     
         58        ECHO                                                     $37
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.8 ms | 1390 KiB | 13 Q