3v4l.org

run code in 500+ PHP versions simultaneously
<?php // can be anything, even always false regex $regex = '~(?<=t)(?<=f)x()(?<named>y)~u'; // add one capturing group to the end so all capture group keys // are present in the $matches $regex = preg_replace('~^(.)(.*)\K(\1\w*$)~', '|()$3', $regex); var_dump($regex); preg_match($regex, '', $matches); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sOXbn
function name:  (null)
number of ops:  16
compiled vars:  !0 = $regex, !1 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, '%7E%28%3F%3C%3Dt%29%28%3F%3C%3Df%29x%28%29%28%3F%3Cnamed%3Ey%29%7Eu'
    8     1        FRAMELESS_ICALL_3                preg_replace        ~3      '%7E%5E%28.%29%28.%2A%29%5CK%28%5C1%5Cw%2A%24%29%7E', '%7C%28%29%243'
          2        OP_DATA                                                      !0
          3        ASSIGN                                                       !0, ~3
   10     4        INIT_FCALL                                                   'var_dump'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                                     
   11     7        INIT_FCALL                                                   'preg_match'
          8        SEND_VAR                                                     !0
          9        SEND_VAL                                                     ''
         10        SEND_REF                                                     !1
         11        DO_ICALL                                                     
   12    12        INIT_FCALL                                                   'print_r'
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                                     
         15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
184.88 ms | 3367 KiB | 16 Q