3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clean($string) { $string = str_replace(' ', '', $string); return preg_replace('/[^A-Za-z0-9\-]', '', $string); } $string = 'Lee%-&*d#'; echo clean($string); echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1AQ6Y
function name:  (null)
number of ops:  7
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'Lee%25-%26%2Ad%23'
    9     1        INIT_FCALL                                               'clean'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   10     5        ECHO                                                     !0
          6      > RETURN                                                   1

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

End of function clean

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.82 ms | 1397 KiB | 18 Q