3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cleanse($string) { if (get_magic_quotes_gpc()) { $string = stripslashes($stringIn); } $search = array('ñ', '&acirc;€“','&acirc;€œ','&acirc;€˜','&acirc;€™','&Acirc;&pound;','&Acirc;&not;','&acirc;„&cent;'); $replace = array('&ntilde', '-','&ldquo;','&lsquo;','&rsquo;','&pound;','&not;','&#8482;'); $string = str_replace($search, $replace, $string); $string = str_replace('&acirc;€', '&rdquo;', $string); $search = array("&#39;", "\xc3\xa2\xc2\x80\xc2\x99", "\xc3\xa2\xc2\x80\xc2\x93", "\xc3\xa2\xc2\x80\xc2\x9d", "\xc3\xa2\x3f\x3f"); $resplace = array("'", "'", ' - ', '"', "'"); $string = str_replace($search, $replace, $string); $quotes = array( "\xC2\xAB" => '"', "\xC2\xBB" => '"', "\xE2\x80\x98" => "'", "\xE2\x80\x99" => "'", "\xE2\x80\x9A" => "'", "\xE2\x80\x9B" => "'", "\xE2\x80\x9C" => '"', "\xE2\x80\x9D" => '"', "\xE2\x80\x9E" => '"', "\xE2\x80\x9F" => '"', "\xE2\x80\xB9" => "'", "\xE2\x80\xBA" => "'", "\xe2\x80\x93" => "-", "\xc2\xb0" => "°", "\xc2\xba" => "°", "\xc3\xb1" => "&#241;", "\x96" => "&#241;", "\xe2\x81\x83" => '&bull;', "\xd5" => "'" ); return strtr($string, $quotes); } echo cleanse('Feliz cumpleaños RatingCero.com: los saludos de los famosos y colegas á');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eWPcd
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   INIT_FCALL                                               'cleanse'
          1        SEND_VAL                                                 'Feliz+cumplea%C3%B1os+RatingCero.com%3A+los+saludos+de+los+famosos+y+colegas+%C3%A1'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function cleanse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/eWPcd
function name:  cleanse
number of ops:  37
compiled vars:  !0 = $string, !1 = $stringIn, !2 = $search, !3 = $replace, !4 = $resplace, !5 = $quotes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL_BY_NAME                                       'get_magic_quotes_gpc'
          2        DO_FCALL                                      0  $6      
          3      > JMPZ                                                     $6, ->8
    5     4    >   INIT_FCALL                                               'stripslashes'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !0, $7
    8     8    >   ASSIGN                                                   !2, <array>
    9     9        ASSIGN                                                   !3, <array>
   11    10        INIT_FCALL                                               'str_replace'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !3
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !0, $11
   12    16        INIT_FCALL                                               'str_replace'
         17        SEND_VAL                                                 '%26acirc%3B%E2%82%AC'
         18        SEND_VAL                                                 '%26rdquo%3B'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !0, $13
   14    22        ASSIGN                                                   !2, <array>
   15    23        ASSIGN                                                   !4, <array>
   17    24        INIT_FCALL                                               'str_replace'
         25        SEND_VAR                                                 !2
         26        SEND_VAR                                                 !3
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !0, $17
   19    30        ASSIGN                                                   !5, <array>
   41    31        INIT_FCALL                                               'strtr'
         32        SEND_VAR                                                 !0
         33        SEND_VAR                                                 !5
         34        DO_ICALL                                         $20     
         35      > RETURN                                                   $20
   42    36*     > RETURN                                                   null

End of function cleanse

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.61 ms | 1402 KiB | 20 Q