3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST["content"] = "<style> color:blue; </style> The rain in Spain lies mainly in the plain ..."; $dom = new DOMDocument; $dom->loadHTML($_POST["content"]); $style_tags = $dom->GetElementsByTagName('style'); foreach($style_tags as $style_tag) { $prent = $style_tag->parentNode; $prent->replaceChild($dom->createTextNode(''), $style_tag); } echo strip_tags($dom->saveHTML());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/VKCOG
function name:  (null)
number of ops:  36
compiled vars:  !0 = $dom, !1 = $style_tags, !2 = $style_tag, !3 = $prent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $4      '_POST'
          1        ASSIGN_DIM                                               $4, 'content'
    4     2        OP_DATA                                                  '%3Cstyle%3E%0Acolor%3Ablue%3B%0A%3C%2Fstyle%3E%0AThe+rain+in+Spain+lies+mainly+in+the+plain+...'
    9     3        NEW                                              $6      'DOMDocument'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $6
   10     6        INIT_METHOD_CALL                                         !0, 'loadHTML'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_FUNC_ARG               global              $9      '_POST'
          9        FETCH_DIM_FUNC_ARG                               $10     $9, 'content'
         10        SEND_FUNC_ARG                                            $10
         11        DO_FCALL                                      0          
   11    12        INIT_METHOD_CALL                                         !0, 'GetElementsByTagName'
         13        SEND_VAL_EX                                              'style'
         14        DO_FCALL                                      0  $12     
         15        ASSIGN                                                   !1, $12
   13    16      > FE_RESET_R                                       $14     !1, ->28
         17    > > FE_FETCH_R                                               $14, !2, ->28
   15    18    >   FETCH_OBJ_R                                      ~15     !2, 'parentNode'
         19        ASSIGN                                                   !3, ~15
   16    20        INIT_METHOD_CALL                                         !3, 'replaceChild'
         21        INIT_METHOD_CALL                                         !0, 'createTextNode'
         22        SEND_VAL_EX                                              ''
         23        DO_FCALL                                      0  $17     
         24        SEND_VAR_NO_REF_EX                                       $17
         25        SEND_VAR_EX                                              !2
         26        DO_FCALL                                      0          
   13    27      > JMP                                                      ->17
         28    >   FE_FREE                                                  $14
   20    29        INIT_FCALL                                               'strip_tags'
         30        INIT_METHOD_CALL                                         !0, 'saveHTML'
         31        DO_FCALL                                      0  $19     
         32        SEND_VAR                                                 $19
         33        DO_ICALL                                         $20     
         34        ECHO                                                     $20
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.92 ms | 1003 KiB | 14 Q