3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '[Salut] [toi][,] [ça] [va] [?]'; $regex = '/\[.*\]/im'; preg_replace($regex, '$1', $new_string); var_dump($new_string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qjPqR
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $regex, !2 = $new_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5BSalut%5D+%5Btoi%5D%5B%2C%5D+%5B%C3%A7a%5D+%5Bva%5D+%5B%3F%5D'
    3     1        ASSIGN                                                   !1, '%2F%5C%5B.%2A%5C%5D%2Fim'
    5     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '%241'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                                 
    7     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.66 ms | 1394 KiB | 17 Q