3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inliner_bypass_matches_total = 0; $inliner_bypass_matches = array(); $the_html = '<style class="sp_bypassInliner">div.class {width:100%}</style>'; $dom = new DOMDocument(); $dom->formatOutput = false; $dom->preserveWhiteSpace = false; $dom->strictErrorChecking = false; $dom->validateOnParse = false; $the_html = str_replace('&nbsp;', '@nbsp;', $the_html); $dom->loadHTML(mb_convert_encoding('<?xml version="1.0" encoding="UTF-8"?>' . "\n" .$the_html, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); $nodes = $xpath->query("//*[contains(@class, 'sp_bypassInliner')]"); $node_count = $nodes->length; if ($node_count > 0) { // Work from the bottom up, so we don't mess anything up. for ($i=$node_count; $i>0; --$i) { $node = $nodes->item($i-1); $inliner_bypass_matches_total++; $html_fragment = $node->nodeValue; $inliner_bypass_matches[$inliner_bypass_matches_total] = $html_fragment; $inliner_bypass_tags = $dom->createDocumentFragment(); $inliner_bypass_tags->appendXML("<!--sp_bypassInliner$inliner_bypass_matches_total-->"); $node->parentNode->replaceChild($inliner_bypass_tags, $node); } $the_html = $dom->saveHTML($dom->documentElement); // $the_html = dom_savehtml_cleanup($the_html); } else $the_html = str_replace('@nbsp;', '&nbsp;', $the_html); echo $dom->saveHTML($the_html[0]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 78
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 71, Position 2 = 44
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 71, Position 2 = 44
Branch analysis from position: 71
Branch analysis from position: 44
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dTi4e
function name:  (null)
number of ops:  91
compiled vars:  !0 = $inliner_bypass_matches_total, !1 = $inliner_bypass_matches, !2 = $the_html, !3 = $dom, !4 = $xpath, !5 = $nodes, !6 = $node_count, !7 = $i, !8 = $node, !9 = $html_fragment, !10 = $inliner_bypass_tags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, '%3Cstyle+class%3D%22sp_bypassInliner%22%3Ediv.class+%7Bwidth%3A100%25%7D%3C%2Fstyle%3E'
    6     3        NEW                                              $14     'DOMDocument'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !3, $14
    7     6        ASSIGN_OBJ                                               !3, 'formatOutput'
          7        OP_DATA                                                  <false>
    8     8        ASSIGN_OBJ                                               !3, 'preserveWhiteSpace'
          9        OP_DATA                                                  <false>
    9    10        ASSIGN_OBJ                                               !3, 'strictErrorChecking'
         11        OP_DATA                                                  <false>
   10    12        ASSIGN_OBJ                                               !3, 'validateOnParse'
         13        OP_DATA                                                  <false>
   11    14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '%26nbsp%3B'
         16        SEND_VAL                                                 '%40nbsp%3B'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $21     
         19        ASSIGN                                                   !2, $21
   12    20        INIT_METHOD_CALL                                         !3, 'loadHTML'
         21        INIT_FCALL                                               'mb_convert_encoding'
         22        CONCAT                                           ~23     '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A', !2
         23        SEND_VAL                                                 ~23
         24        SEND_VAL                                                 'HTML-ENTITIES'
         25        SEND_VAL                                                 'UTF-8'
         26        DO_ICALL                                         $24     
         27        SEND_VAR_NO_REF_EX                                       $24
         28        SEND_VAL_EX                                              4
         29        DO_FCALL                                      0          
   14    30        NEW                                              $26     'DOMXPath'
         31        SEND_VAR_EX                                              !3
         32        DO_FCALL                                      0          
         33        ASSIGN                                                   !4, $26
   15    34        INIT_METHOD_CALL                                         !4, 'query'
         35        SEND_VAL_EX                                              '%2F%2F%2A%5Bcontains%28%40class%2C+%27sp_bypassInliner%27%29%5D'
         36        DO_FCALL                                      0  $29     
         37        ASSIGN                                                   !5, $29
   17    38        FETCH_OBJ_R                                      ~31     !5, 'length'
         39        ASSIGN                                                   !6, ~31
   19    40        IS_SMALLER                                               0, !6
         41      > JMPZ                                                     ~33, ->78
   22    42    >   ASSIGN                                                   !7, !6
         43      > JMP                                                      ->69
   24    44    >   INIT_METHOD_CALL                                         !5, 'item'
         45        SUB                                              ~35     !7, 1
         46        SEND_VAL_EX                                              ~35
         47        DO_FCALL                                      0  $36     
         48        ASSIGN                                                   !8, $36
   26    49        PRE_INC                                                  !0
   28    50        FETCH_OBJ_R                                      ~39     !8, 'nodeValue'
         51        ASSIGN                                                   !9, ~39
   30    52        ASSIGN_DIM                                               !1, !0
         53        OP_DATA                                                  !9
   32    54        INIT_METHOD_CALL                                         !3, 'createDocumentFragment'
         55        DO_FCALL                                      0  $42     
         56        ASSIGN                                                   !10, $42
   33    57        INIT_METHOD_CALL                                         !10, 'appendXML'
         58        ROPE_INIT                                     3  ~45     '%3C%21--sp_bypassInliner'
         59        ROPE_ADD                                      1  ~45     ~45, !0
         60        ROPE_END                                      2  ~44     ~45, '--%3E'
         61        SEND_VAL_EX                                              ~44
         62        DO_FCALL                                      0          
   35    63        FETCH_OBJ_R                                      ~48     !8, 'parentNode'
         64        INIT_METHOD_CALL                                         ~48, 'replaceChild'
         65        SEND_VAR_EX                                              !10
         66        SEND_VAR_EX                                              !8
         67        DO_FCALL                                      0          
   22    68        PRE_DEC                                                  !7
         69    >   IS_SMALLER                                               0, !7
         70      > JMPNZ                                                    ~51, ->44
   38    71    >   INIT_METHOD_CALL                                         !3, 'saveHTML'
         72        CHECK_FUNC_ARG                                           
         73        FETCH_OBJ_FUNC_ARG                               $52     !3, 'documentElement'
         74        SEND_FUNC_ARG                                            $52
         75        DO_FCALL                                      0  $53     
         76        ASSIGN                                                   !2, $53
   19    77      > JMP                                                      ->84
   42    78    >   INIT_FCALL                                               'str_replace'
         79        SEND_VAL                                                 '%40nbsp%3B'
         80        SEND_VAL                                                 '%26nbsp%3B'
         81        SEND_VAR                                                 !2
         82        DO_ICALL                                         $55     
         83        ASSIGN                                                   !2, $55
   44    84    >   INIT_METHOD_CALL                                         !3, 'saveHTML'
         85        CHECK_FUNC_ARG                                           
         86        FETCH_DIM_FUNC_ARG                               $57     !2, 0
         87        SEND_FUNC_ARG                                            $57
         88        DO_FCALL                                      0  $58     
         89        ECHO                                                     $58
         90      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.16 ms | 1085 KiB | 15 Q