3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = <<<HTML <script> console.log('<h1>aaa<\/h1>'); </script> HTML; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"), LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ldGmr
function name:  (null)
number of ops:  20
compiled vars:  !0 = $html, !1 = $dom
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cscript%3E%0A++++console.log%28%27%3Ch1%3Eaaa%3C%5C%2Fh1%3E%27%29%3B%0A%3C%2Fscript%3E'
    8     1        NEW                                                  $3      'DOMDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $3
    9     4        INIT_FCALL                                                   'libxml_use_internal_errors'
          5        SEND_VAL                                                     <true>
          6        DO_ICALL                                                     
   10     7        INIT_METHOD_CALL                                             !1, 'loadHTML'
          8        INIT_FCALL                                                   'mb_convert_encoding'
          9        SEND_VAR                                                     !0
         10        SEND_VAL                                                     'HTML-ENTITIES'
         11        SEND_VAL                                                     'UTF-8'
         12        DO_ICALL                                             $7      
         13        SEND_VAR_NO_REF_EX                                           $7
         14        SEND_VAL_EX                                                  8196
         15        DO_FCALL                                          0          
   12    16        INIT_METHOD_CALL                                             !1, 'saveHTML'
         17        DO_FCALL                                          0  $9      
         18        ECHO                                                         $9
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.37 ms | 2628 KiB | 15 Q