3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clean($string) { return preg_replace('/[^A-Za-z0-9.\/\-_~]/', '', $string); } $toClean = ' abcDEF123./-_~àéèùïî% *\@& '; var_dump($toClean); var_dump(clean($toClean));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MF8SM
function name:  (null)
number of ops:  11
compiled vars:  !0 = $toClean
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '+abcDEF123.%2F-_%7E%C3%A0%C3%A9%C3%A8%C3%B9%C3%AF%C3%AE%25+%2A%5C%40%26+'
    9     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   10     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'clean'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function clean:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MF8SM
function name:  clean
number of ops:  8
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5EA-Za-z0-9.%5C%2F%5C-_%7E%5D%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    5     7*     > RETURN                                                   null

End of function clean

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.38 ms | 1402 KiB | 18 Q