3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fixtags($text){ $text = htmlspecialchars($text); console.log($text); $text = preg_replace("/=/", "=\"\"", $text); console.log($text); $text = preg_replace("/&quot;/", "&quot;\"", $text); console.log($text); $tags = "/&lt;(\/|)(\w*)(\ |)(\w*)([\\\=]*)(?|(\")\"&quot;\"|)(?|(.*)?&quot;(\")|)([\ ]?)(\/|)&gt;/i(\&lt;h[1-9]&gt;)"; $replacement = "<$1$2$3$4$5$6$7$8$9$10>"; $text = preg_replace($tags, $replacement, $text); console.log($text); $text = preg_replace("/=\"\"/", "=", $text); console.log($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> <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/VUGqT
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ECHO                                                     '%0A'
   19     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%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
   28     5      > RETURN                                                   1

Function fixtags:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VUGqT
function name:  fixtags
number of ops:  63
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        FETCH_CONSTANT                                   ~5      'console'
          6        INIT_FCALL                                               'log'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        CONCAT                                           ~7      ~5, $6
         10        FREE                                                     ~7
    6    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%3D%2F'
         13        SEND_VAL                                                 '%3D%22%22'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !0, $8
    7    17        FETCH_CONSTANT                                   ~10     'console'
         18        INIT_FCALL                                               'log'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $11     
         21        CONCAT                                           ~12     ~10, $11
         22        FREE                                                     ~12
    8    23        INIT_FCALL                                               'preg_replace'
         24        SEND_VAL                                                 '%2F%26quot%3B%2F'
         25        SEND_VAL                                                 '%26quot%3B%22'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $13     
         28        ASSIGN                                                   !0, $13
    9    29        FETCH_CONSTANT                                   ~15     'console'
         30        INIT_FCALL                                               'log'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $16     
         33        CONCAT                                           ~17     ~15, $16
         34        FREE                                                     ~17
   10    35        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%28%5C%26lt%3Bh%5B1-9%5D%26gt%3B%29'
   11    36        ASSIGN                                                   !2, '%3C%241%242%243%244%245%246%247%248%249%2410%3E'
   12    37        INIT_FCALL                                               'preg_replace'
         38        SEND_VAR                                                 !1
         39        SEND_VAR                                                 !2
         40        SEND_VAR                                                 !0
         41        DO_ICALL                                         $20     
         42        ASSIGN                                                   !0, $20
   13    43        FETCH_CONSTANT                                   ~22     'console'
         44        INIT_FCALL                                               'log'
         45        SEND_VAR                                                 !0
         46        DO_ICALL                                         $23     
         47        CONCAT                                           ~24     ~22, $23
         48        FREE                                                     ~24
   14    49        INIT_FCALL                                               'preg_replace'
         50        SEND_VAL                                                 '%2F%3D%22%22%2F'
         51        SEND_VAL                                                 '%3D'
         52        SEND_VAR                                                 !0
         53        DO_ICALL                                         $25     
         54        ASSIGN                                                   !0, $25
   15    55        FETCH_CONSTANT                                   ~27     'console'
         56        INIT_FCALL                                               'log'
         57        SEND_VAR                                                 !0
         58        DO_ICALL                                         $28     
         59        CONCAT                                           ~29     ~27, $28
         60        FREE                                                     ~29
   16    61      > RETURN                                                   !0
   17    62*     > RETURN                                                   null

End of function fixtags

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.93 ms | 1403 KiB | 20 Q