3v4l.org

run code in 300+ 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:  19
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        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7E%5E%28.%29%28.%2A%29%5CK%28%5C1%5Cw%2A%24%29%7E'
          3        SEND_VAL                                                 '%7C%28%29%243'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
   10     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   11    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 ''
         13        SEND_REF                                                 !1
         14        DO_ICALL                                                 
   12    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142 ms | 1439 KiB | 17 Q