3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $doc->loadHTML("<html></html>"); $f = $doc->createDocumentFragment(); $f->appendXML(' <script> // <invalid comment </script> '); $doc->documentElement->appendChild($f); echo $doc->saveHTML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r4Gq6
function name:  (null)
number of ops:  20
compiled vars:  !0 = $doc, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
          4        SEND_VAL_EX                                              '%3Chtml%3E%3C%2Fhtml%3E'
          5        DO_FCALL                                      0          
    4     6        INIT_METHOD_CALL                                         !0, 'createDocumentFragment'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
    5     9        INIT_METHOD_CALL                                         !1, 'appendXML'
         10        SEND_VAL_EX                                              '%0A%3Cscript%3E%0A%2F%2F+%3Cinvalid+comment%0A%3C%2Fscript%3E%0A'
         11        DO_FCALL                                      0          
   10    12        FETCH_OBJ_R                                      ~9      !0, 'documentElement'
         13        INIT_METHOD_CALL                                         ~9, 'appendChild'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
   11    16        INIT_METHOD_CALL                                         !0, 'saveHTML'
         17        DO_FCALL                                      0  $11     
         18        ECHO                                                     $11
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.57 ms | 1393 KiB | 13 Q