3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '[Salut] [toi][,] [ça] [va] [?]'; $regex = '/\[.*\]/im'; $new_string = ''; 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/JfUml
function name:  (null)
number of ops:  12
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'
    4     2        ASSIGN                                                   !2, ''
    6     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 '%241'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                                 
    8     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.18 ms | 1394 KiB | 17 Q