3v4l.org

run code in 300+ 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:  15
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
    5     2        SEND_VAL                                                 '%2F%5CW%2B%2F'
    6     3        SEND_VAL                                                 ''
    7     4        INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 '+'
          6        SEND_VAL                                                 '_'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $1      
          9        SEND_VAR                                                 $1
    4    10        DO_ICALL                                         $2      
    7    11        VERIFY_RETURN_TYPE                                       $2
         12      > RETURN                                                   $2
    9    13*       VERIFY_RETURN_TYPE                                       
         14*     > RETURN                                                   null

End of function sanitizefilename

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.59 ms | 1008 KiB | 16 Q