3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F\xA0\xC2 \xc2blabla"; //$result="a\xC2"; ini_set('mbstring.substitute_character', "none"); echo mb_convert_encoding($result, 'UTF-8', 'UTF-8'); exit; $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~', '', $result); echo @iconv("UTF-8", "UTF-8//IGNORE", $result); exit; $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~', '?', $result); $string = "°Freen\x18 ew°\x90ɮ\x7F\xc2"; $string = preg_replace("#[\x09\x0A\x0D\x20-\x7E]#" ,"",$string); // ASCII $string = preg_replace("#[\xC2-\xDF][\x80-\xBF]#" ,"",$string); // non-overlong 2-byte $string = preg_replace("#\xE0[\xA0-\xBF][\x80-\xBF]#" ,"",$string); // excluding overlongs $string = preg_replace("#[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}#","",$string); // straight 3-byte $string = preg_replace("#\xED[\x80-\x9F][\x80-\xBF]#" ,"",$string); // excluding surrogates $string = preg_replace("#\xF0[\x90-\xBF][\x80-\xBF]{2}#","",$string); // planes 1-3 $string = preg_replace("#[\xF1-\xF3][\x80-\xBF]{3}#" ,"",$string); // planes 4-15 $string = preg_replace("#\xF4[\x80-\x8F][\x80-\xBF]{2}#","",$string); // plane 16 //reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? $result= preg_replace( '/[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})/S', '', $result ); if($result == "\xC2") echo 'fuck'; echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/Vuvs1
function name:  (null)
number of ops:  93
compiled vars:  !0 = $result, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%C2%C2%B0Freen%18+ew%C2%B0%90%C9%AE%7F%A0%C2+%C2blabla'
    5     1        INIT_FCALL                                               'ini_set'
          2        SEND_VAL                                                 'mbstring.substitute_character'
          3        SEND_VAL                                                 'none'
          4        DO_ICALL                                                 
    7     5        INIT_FCALL                                               'mb_convert_encoding'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'UTF-8'
          8        SEND_VAL                                                 'UTF-8'
          9        DO_ICALL                                         $4      
         10        ECHO                                                     $4
   10    11      > EXIT                                                     
   12    12*       INIT_FCALL                                               'preg_replace'
         13*       SEND_VAL                                                 '%7E%5B%5Cx%7B0000%7D-%5Cx%7B000F%7D%5Cx%7B007F%7D-%5Cx%7B00a0%7D%5D%7E'
         14*       SEND_VAL                                                 ''
         15*       SEND_VAR                                                 !0
         16*       DO_ICALL                                         $5      
         17*       ASSIGN                                                   !0, $5
   14    18*       BEGIN_SILENCE                                    ~7      
         19*       INIT_FCALL_BY_NAME                                       'iconv'
         20*       SEND_VAL_EX                                              'UTF-8'
         21*       SEND_VAL_EX                                              'UTF-8%2F%2FIGNORE'
         22*       SEND_VAR_EX                                              !0
         23*       DO_FCALL                                      0  $8      
         24*       END_SILENCE                                              ~7
         25*       ECHO                                                     $8
   15    26*       EXIT                                                     
   16    27*       INIT_FCALL                                               'preg_replace'
         28*       SEND_VAL                                                 '%7E%5B%5Cx%7B0000%7D-%5Cx%7B000F%7D%5Cx%7B007F%7D-%5Cx%7B00a0%7D%5D%7E'
         29*       SEND_VAL                                                 '%3F'
         30*       SEND_VAR                                                 !0
         31*       DO_ICALL                                         $9      
         32*       ASSIGN                                                   !0, $9
   20    33*       ASSIGN                                                   !1, '%C2%B0Freen%18+ew%C2%B0%90%C9%AE%7F%C2'
   21    34*       INIT_FCALL                                               'preg_replace'
         35*       SEND_VAL                                                 '%23%5B%09%0A%0D+-%7E%5D%23'
         36*       SEND_VAL                                                 ''
         37*       SEND_VAR                                                 !1
         38*       DO_ICALL                                         $12     
         39*       ASSIGN                                                   !1, $12
   22    40*       INIT_FCALL                                               'preg_replace'
         41*       SEND_VAL                                                 '%23%5B%C2-%DF%5D%5B%80-%BF%5D%23'
         42*       SEND_VAL                                                 ''
         43*       SEND_VAR                                                 !1
         44*       DO_ICALL                                         $14     
         45*       ASSIGN                                                   !1, $14
   23    46*       INIT_FCALL                                               'preg_replace'
         47*       SEND_VAL                                                 '%23%E0%5B%A0-%BF%5D%5B%80-%BF%5D%23'
         48*       SEND_VAL                                                 ''
         49*       SEND_VAR                                                 !1
         50*       DO_ICALL                                         $16     
         51*       ASSIGN                                                   !1, $16
   24    52*       INIT_FCALL                                               'preg_replace'
         53*       SEND_VAL                                                 '%23%5B%E1-%EC%EE%EF%5D%5B%80-%BF%5D%7B2%7D%23'
         54*       SEND_VAL                                                 ''
         55*       SEND_VAR                                                 !1
         56*       DO_ICALL                                         $18     
         57*       ASSIGN                                                   !1, $18
   25    58*       INIT_FCALL                                               'preg_replace'
         59*       SEND_VAL                                                 '%23%ED%5B%80-%9F%5D%5B%80-%BF%5D%23'
         60*       SEND_VAL                                                 ''
         61*       SEND_VAR                                                 !1
         62*       DO_ICALL                                         $20     
         63*       ASSIGN                                                   !1, $20
   26    64*       INIT_FCALL                                               'preg_replace'
         65*       SEND_VAL                                                 '%23%F0%5B%90-%BF%5D%5B%80-%BF%5D%7B2%7D%23'
         66*       SEND_VAL                                                 ''
         67*       SEND_VAR                                                 !1
         68*       DO_ICALL                                         $22     
         69*       ASSIGN                                                   !1, $22
   27    70*       INIT_FCALL                                               'preg_replace'
         71*       SEND_VAL                                                 '%23%5B%F1-%F3%5D%5B%80-%BF%5D%7B3%7D%23'
         72*       SEND_VAL                                                 ''
         73*       SEND_VAR                                                 !1
         74*       DO_ICALL                                         $24     
         75*       ASSIGN                                                   !1, $24
   28    76*       INIT_FCALL                                               'preg_replace'
         77*       SEND_VAL                                                 '%23%F4%5B%80-%8F%5D%5B%80-%BF%5D%7B2%7D%23'
         78*       SEND_VAL                                                 ''
         79*       SEND_VAR                                                 !1
         80*       DO_ICALL                                         $26     
         81*       ASSIGN                                                   !1, $26
   31    82*       INIT_FCALL                                               'preg_replace'
   32    83*       SEND_VAL                                                 '%2F%5B%5CxC2-%5CxDF%5D%28%28%3F%21%5B%5Cx80-%5CxBF%5D%29%7C%5B%5Cx80-%5CxBF%5D%7B2%2C%7D%29%2FS'
   33    84*       SEND_VAL                                                 ''
         85*       SEND_VAR                                                 !0
         86*       DO_ICALL                                         $28     
   31    87*       ASSIGN                                                   !0, $28
   36    88*       IS_EQUAL                                                 !0, '%C2'
         89*       JMPZ                                                     ~30, ->91
   37    90*       ECHO                                                     'fuck'
   39    91*       ECHO                                                     !0
         92*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.52 ms | 1404 KiB | 22 Q