3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = ' <p>somthing</p> <pre> <code> <span>x</span> <span>y</span> <span>;</span> <div></div> </code> <ul> <li>1</li> </ul> </pre>'; $doc = new DOMDocument(); $docFragment = $doc->createDocumentFragment(); $docFragment->appendXML($html); $doc->appendChild($docFragment); echo $doc->saveHTML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sU0sB
function name:  (null)
number of ops:  17
compiled vars:  !0 = $html, !1 = $doc, !2 = $docFragment
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%3Cp%3Esomthing%3C%2Fp%3E%0A%3Cpre%3E%0A+++%3Ccode%3E+%0A++++%3Cspan%3Ex%3C%2Fspan%3E%0A++++%3Cspan%3Ey%3C%2Fspan%3E%0A++++%3Cspan%3E%3B%3C%2Fspan%3E%0A++++%3Cdiv%3E%3C%2Fdiv%3E%0A+++%3C%2Fcode%3E%0A+++%3Cul%3E%0A++++++%3Cli%3E1%3C%2Fli%3E%0A+++%3C%2Ful%3E%0A%3C%2Fpre%3E'
   17     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   18     4        INIT_METHOD_CALL                                         !1, 'createDocumentFragment'
          5        DO_FCALL                                      0  $7      
          6        ASSIGN                                                   !2, $7
   19     7        INIT_METHOD_CALL                                         !2, 'appendXML'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   20    10        INIT_METHOD_CALL                                         !1, 'appendChild'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0          
   21    13        INIT_METHOD_CALL                                         !1, 'saveHTML'
         14        DO_FCALL                                      0  $11     
         15        ECHO                                                     $11
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.85 ms | 994 KiB | 13 Q