3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <footer xmlns:t="ddtemplate"> <p> <t:span child="sign-in" class="sign-in" /> <t:span child="copyright" class="footer-copyright" /> </p> </footer> XML; $doc = DOMDocument::loadXML($xml); define('START_TIME', microtime(1)); /* Template Values */ $tv = array(); $f = $doc->createDocumentFragment(); $f->appendXML('<a href="#url">Sign In to Edit this Site</a>'); $tv['sign-in'] = $f; $tv['copyright'] = $doc->createTextNode('&copy;' . date('Y') . ' ' . SITE); foreach($doc->getElementsByTagNameNS('ddtemplate','*') as $el) { $el->appendChild($tv[$el->getAttribute('child')]); } echo $doc->saveHTML(); var_dump(microtime(1) - START_TIME);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 48
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 48
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
filename:       /in/qCgaf
function name:  (null)
number of ops:  61
compiled vars:  !0 = $xml, !1 = $doc, !2 = $tv, !3 = $f, !4 = $el
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%09%3Cfooter+xmlns%3At%3D%22ddtemplate%22%3E%0A++++%3Cp%3E%0A++++++%3Ct%3Aspan+child%3D%22sign-in%22+class%3D%22sign-in%22+%2F%3E%0A++++++%3Ct%3Aspan+child%3D%22copyright%22+class%3D%22footer-copyright%22+%2F%3E%0A++++%3C%2Fp%3E%0A%09%3C%2Ffooter%3E'
   11     1        INIT_STATIC_METHOD_CALL                                  'DOMDocument', 'loadXML'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $6      
          4        ASSIGN                                                   !1, $6
   13     5        INIT_FCALL                                               'define'
          6        SEND_VAL                                                 'START_TIME'
          7        INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                                 
   16    12        ASSIGN                                                   !2, <array>
   18    13        INIT_METHOD_CALL                                         !1, 'createDocumentFragment'
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                                   !3, $11
   20    16        INIT_METHOD_CALL                                         !3, 'appendXML'
         17        SEND_VAL_EX                                              '%3Ca+href%3D%22%23url%22%3ESign+In+to+Edit+this+Site%3C%2Fa%3E'
         18        DO_FCALL                                      0          
   22    19        ASSIGN_DIM                                               !2, 'sign-in'
         20        OP_DATA                                                  !3
   23    21        INIT_METHOD_CALL                                         !1, 'createTextNode'
         22        INIT_FCALL                                               'date'
         23        SEND_VAL                                                 'Y'
         24        DO_ICALL                                         $16     
         25        CONCAT                                           ~17     '%26copy%3B', $16
         26        CONCAT                                           ~18     ~17, '+'
         27        FETCH_CONSTANT                                   ~19     'SITE'
         28        CONCAT                                           ~20     ~18, ~19
         29        SEND_VAL_EX                                              ~20
         30        DO_FCALL                                      0  $21     
         31        ASSIGN_DIM                                               !2, 'copyright'
         32        OP_DATA                                                  $21
   25    33        INIT_METHOD_CALL                                         !1, 'getElementsByTagNameNS'
         34        SEND_VAL_EX                                              'ddtemplate'
         35        SEND_VAL_EX                                              '%2A'
         36        DO_FCALL                                      0  $22     
         37      > FE_RESET_R                                       $23     $22, ->48
         38    > > FE_FETCH_R                                               $23, !4, ->48
   26    39    >   INIT_METHOD_CALL                                         !4, 'appendChild'
         40        CHECK_FUNC_ARG                                           
         41        INIT_METHOD_CALL                                         !4, 'getAttribute'
         42        SEND_VAL_EX                                              'child'
         43        DO_FCALL                                      0  $24     
         44        FETCH_DIM_FUNC_ARG                               $25     !2, $24
         45        SEND_FUNC_ARG                                            $25
         46        DO_FCALL                                      0          
   25    47      > JMP                                                      ->38
         48    >   FE_FREE                                                  $23
   29    49        INIT_METHOD_CALL                                         !1, 'saveHTML'
         50        DO_FCALL                                      0  $27     
         51        ECHO                                                     $27
   31    52        INIT_FCALL                                               'var_dump'
         53        INIT_FCALL                                               'microtime'
         54        SEND_VAL                                                 1
         55        DO_ICALL                                         $28     
         56        FETCH_CONSTANT                                   ~29     'START_TIME'
         57        SUB                                              ~30     $28, ~29
         58        SEND_VAL                                                 ~30
         59        DO_ICALL                                                 
         60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.7 ms | 1400 KiB | 21 Q