3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strip_html_tags( $text ) { $text = preg_replace( array( // Remove invisible content '@<head[^>]*?>.*?</head>@siu', '@<style[^>]*?>.*?</style>@siu', '@<script[^>]*?.*?</script>@siu', '@<object[^>]*?.*?</object>@siu', '@<embed[^>]*?.*?</embed>@siu', '@<applet[^>]*?.*?</applet>@siu', '@<noframes[^>]*?.*?</noframes>@siu', '@<noscript[^>]*?.*?</noscript>@siu', '@<noembed[^>]*?.*?</noembed>@siu' ), array( '', '', '', '', '', '', '', '', ''), $text ); return strip_tags( $text); } function make_safe($variable) { $variable = strip_html_tags($variable); $bad = array("=","<", ">", "/","\"","`","~","'","$","%","#"); $variable = str_replace($bad, "", $variable); $variable = (trim($variable)); echo $variable; } make_safe("<p>Test-A bsatz. </p>"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uoFAc
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_FCALL                                               'make_safe'
          1        SEND_VAL                                                 '%3Cp%3ETest-A+++++++++++++bsatz.+%3C%2Fp%3E'
          2        DO_FCALL                                      0          
   33     3      > RETURN                                                   1

Function strip_html_tags:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uoFAc
function name:  strip_html_tags
number of ops:  12
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
    7     2        SEND_VAL                                                 <array>
   18     3        SEND_VAL                                                 <array>
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
    4     6        ASSIGN                                                   !0, $1
   20     7        INIT_FCALL                                               'strip_tags'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
   21    11*     > RETURN                                                   null

End of function strip_html_tags

Function make_safe:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uoFAc
function name:  make_safe
number of ops:  18
compiled vars:  !0 = $variable, !1 = $bad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        INIT_FCALL                                               'strip_html_tags'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !0, $2
   26     5        ASSIGN                                                   !1, <array>
   27     6        INIT_FCALL                                               'str_replace'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 ''
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !0, $5
   28    12        INIT_FCALL                                               'trim'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !0, $7
   29    16        ECHO                                                     !0
   30    17      > RETURN                                                   null

End of function make_safe

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.96 ms | 1390 KiB | 23 Q