3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sanitizecamp($campname) { $campname = preg_replace('/[^\w\d_ -\"]/si', '', $campname); //replace 'double quotes' with '-' $campname = preg_replace('/[\"]/s', '-', $campname); $campname = str_replace(' ', '_', $campname); return $campname; } echo sanitizecamp('/../dfdd');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RrZ8X
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'sanitizecamp'
          1        SEND_VAL                                                 '%2F..%2Fdfdd'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function sanitizecamp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RrZ8X
function name:  sanitizecamp
number of ops:  21
compiled vars:  !0 = $campname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5E%5Cw%5Cd_+-%5C%22%5D%2Fsi'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        ASSIGN                                                   !0, $1
    8     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%5B%5C%22%5D%2Fs'
          9        SEND_VAL                                                 '-'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $3      
         12        ASSIGN                                                   !0, $3
    9    13        INIT_FCALL                                               'str_replace'
         14        SEND_VAL                                                 '+'
         15        SEND_VAL                                                 '_'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $5      
         18        ASSIGN                                                   !0, $5
   10    19      > RETURN                                                   !0
   11    20*     > RETURN                                                   null

End of function sanitizecamp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.08 ms | 1402 KiB | 18 Q