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 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 10
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 10
Branch analysis from position: 58
Branch analysis from position: 10
filename:       /in/MF9ai
function name:  (null)
number of ops:  62
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                                                      ->56
    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        CONCAT                                           ~28     ~27, '+'
         40        SEND_VAL_EX                                              ~28
         41        DO_FCALL                                      0  $29     
         42        SEND_VAR_NO_REF_EX                                       $29
         43        DO_FCALL                                      0          
   16    44        INIT_METHOD_CALL                                         !0, 'importNode'
         45        CHECK_FUNC_ARG                                           
         46        FETCH_OBJ_FUNC_ARG                               $31     !2, 'documentElement'
         47        SEND_FUNC_ARG                                            $31
         48        SEND_VAL_EX                                              <true>
         49        DO_FCALL                                      0  $32     
         50        ASSIGN                                                   !2, $32
   17    51        FETCH_OBJ_R                                      ~34     !0, 'documentElement'
         52        INIT_METHOD_CALL                                         ~34, 'appendChild'
         53        SEND_VAR_EX                                              !2
         54        DO_FCALL                                      0          
    6    55        PRE_INC                                                  !1
         56    >   IS_SMALLER_OR_EQUAL                                      !1, 300
         57      > JMPNZ                                                    ~37, ->10
   19    58    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         59        DO_FCALL                                      0  $38     
         60        ECHO                                                     $38
         61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.27 ms | 1399 KiB | 13 Q