3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = 'my file:name?w[ith/illegal*cha]racters\"that<are>not\allowed|here.txt'; $newName = preg_replace('/[\?\/:|<>*\[\]\(\)\$%\{\}@~\s]/', '_', $name); var_dump($newName);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ELOLQ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $name, !1 = $newName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'my+file%3Aname%3Fw%5Bith%2Fillegal%2Acha%5Dracters%5C%22that%3Care%3Enot%5Callowed%7Chere.txt'
    3     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5C%3F%5C%2F%3A%7C%3C%3E%2A%5C%5B%5C%5D%5C%28%5C%29%5C%24%25%5C%7B%5C%7D%40%7E%5Cs%5D%2F'
          3        SEND_VAL                                                 '_'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    4     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.63 ms | 952 KiB | 15 Q