3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DomDocumentFragment(); $dom->loadHTML('<form class="search-form"> <meta itemprop="target"> <input type="search"> <input type="submit"> </form>'); $forms = $dom->getElementsByTagName('form'); $span = $dom->createElement('span', 'hello'); $forms->item(0)->appendChild($span); echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vJSsS
function name:  (null)
number of ops:  25
compiled vars:  !0 = $dom, !1 = $forms, !2 = $span
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DomDocumentFragment'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
          4        SEND_VAL_EX                                              '%3Cform+class%3D%22search-form%22%3E%0A++%3Cmeta+itemprop%3D%22target%22%3E%0A++%3Cinput+type%3D%22search%22%3E%0A++%3Cinput+type%3D%22submit%22%3E%0A%3C%2Fform%3E'
          5        DO_FCALL                                      0          
    9     6        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          7        SEND_VAL_EX                                              'form'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   10    10        INIT_METHOD_CALL                                         !0, 'createElement'
         11        SEND_VAL_EX                                              'span'
         12        SEND_VAL_EX                                              'hello'
         13        DO_FCALL                                      0  $9      
         14        ASSIGN                                                   !2, $9
   12    15        INIT_METHOD_CALL                                         !1, 'item'
         16        SEND_VAL_EX                                              0
         17        DO_FCALL                                      0  $11     
         18        INIT_METHOD_CALL                                         $11, 'appendChild'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
   15    21        INIT_METHOD_CALL                                         !0, 'saveHTML'
         22        DO_FCALL                                      0  $13     
         23        ECHO                                                     $13
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.14 ms | 1385 KiB | 13 Q