3v4l.org

run code in 500+ PHP versions simultaneously
<?php function sanitizeFilename(string $name): string { return preg_replace( '/\W+/', '', str_replace(' ', '_', $name) ); } echo sanitizeFilename('This/is My 1! FilenAm3');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d4duv
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'sanitizefilename'
          1        SEND_VAL                                                     'This%2Fis+My+++++1%21+FilenAm3'
          2        DO_FCALL                                          0  $0      
          3        ECHO                                                         $0
          4      > RETURN                                                       1

Function sanitizefilename:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d4duv
function name:  sanitizeFilename
number of ops:  9
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    7     1        FRAMELESS_ICALL_3                str_replace         ~1      '+', '_'
          2        OP_DATA                                                      !0
    4     3        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F%5CW%2B%2F', ''
    7     4        OP_DATA                                                      ~1
          5        VERIFY_RETURN_TYPE                                           ~2
          6      > RETURN                                                       ~2
    9     7*       VERIFY_RETURN_TYPE                                           
          8*     > RETURN                                                       null

End of function sanitizefilename

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
214.32 ms | 1890 KiB | 14 Q