3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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');
based on BdFBq
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/RrZ8X
function name:  (null)
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   NOP                                                      
  13     1        INIT_FCALL                                               'sanitizecamp'
         2        SEND_VAL                                                 '%2F..%2Fdfdd'
         3        DO_FCALL                                      0  $0      
         4        ECHO                                                     $0
         5      > RETURN                                                   1

Function sanitizecamp:
Finding entry points
Branch analysis from position: 0
Jump 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 7.2.0