3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fixtags($text){ $text = htmlspecialchars($text); $text = preg_replace("/=/", "=\"\"", $text); $text = preg_replace("/&quot;/", "&quot;\"", $text); $tags = "/&lt;(\/|)(\w*)(\ |)(\w*)([\\\=]*)(?|(\")\"&quot;\"|)(?|(.*)?&quot;(\")|)([\ ]?)(\/|)&gt;/i"; $replacement = "<$1$2$3$4$5$6$7$8$9$10>"; $text = preg_replace($tags, $replacement, $text); $text = preg_replace("/=\"\"/", "=", $text); return $text; }?> <?php echo fixtags(' content of website ... <h1> Heading (?= 1 for largest to 6 for smallest, eg h1) </h1> <p> Paragraph of Text </p> <b> Bold Text </b> <form> First name: <input type="text" name="firstname"><br> Last name: <input type="text" name="lastname"> </form> <a href="url"> ... </a> <i> Italic Text </i> <u> Underline Text </u> <strike> Strikeout </strike> <sup> Superscript - Smaller text placed below normal text </sup> <sub> ... </sub>');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gagrr
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     '%0A'
   14     1        INIT_FCALL                                               'fixtags'
          2        SEND_VAL                                                 '++content+of+website+...%0A+++++%3Ch1%3E+%09Heading+%28%3F%3D+1+for+largest+to+6+for+smallest%2C+eg+h1%29+%3C%2Fh1%3E%0A%3Cp%3E+Paragraph+of+Text+%3C%2Fp%3E%09%0A%3Cb%3E+Bold+Text+%3C%2Fb%3E%09%0A%3Cform%3E%0AFirst+name%3A+%3Cinput+type%3D%22text%22+name%3D%22firstname%22%3E%3Cbr%3E%0ALast+name%3A+%3Cinput+type%3D%22text%22+name%3D%22lastname%22%3E%0A%3C%2Fform%3E%0A%3Ca+href%3D%22url%22%3E+...+%3C%2Fa%3E%0A%3Ci%3E+Italic+Text+%3C%2Fi%3E%09%0A%3Cu%3E+Underline+Text+%3C%2Fu%3E%09%0A%3Cstrike%3E+%09Strikeout+%3C%2Fstrike%3E%0A%3Csup%3E+Superscript+-+Smaller+text+placed+below+normal+text+%3C%2Fsup%3E%09%0A%3Csub%3E+...+%3C%2Fsub%3E'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
   27     5      > RETURN                                                   1

Function fixtags:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gagrr
function name:  fixtags
number of ops:  33
compiled vars:  !0 = $text, !1 = $tags, !2 = $replacement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'htmlspecialchars'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    5     5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 '%2F%3D%2F'
          7        SEND_VAL                                                 '%3D%22%22'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !0, $5
    6    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%26quot%3B%2F'
         13        SEND_VAL                                                 '%26quot%3B%22'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $7      
         16        ASSIGN                                                   !0, $7
    7    17        ASSIGN                                                   !1, '%2F%26lt%3B%28%5C%2F%7C%29%28%5Cw%2A%29%28%5C+%7C%29%28%5Cw%2A%29%28%5B%5C%5C%3D%5D%2A%29%28%3F%7C%28%22%29%22%26quot%3B%22%7C%29%28%3F%7C%28.%2A%29%3F%26quot%3B%28%22%29%7C%29%28%5B%5C+%5D%3F%29%28%5C%2F%7C%29%26gt%3B%2Fi'
    8    18        ASSIGN                                                   !2, '%3C%241%242%243%244%245%246%247%248%249%2410%3E'
    9    19        INIT_FCALL                                               'preg_replace'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $11     
         24        ASSIGN                                                   !0, $11
   10    25        INIT_FCALL                                               'preg_replace'
         26        SEND_VAL                                                 '%2F%3D%22%22%2F'
         27        SEND_VAL                                                 '%3D'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $13     
         30        ASSIGN                                                   !0, $13
   11    31      > RETURN                                                   !0
   12    32*     > RETURN                                                   null

End of function fixtags

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.38 ms | 1403 KiB | 18 Q