3v4l.org

run code in 300+ PHP versions simultaneously
<?php $p = '~(?J)(z?)((?1)(?P<group>b)|(?P<group>a))ba~'; // works $p = '~(?J)(z?)((?1)(?P<group>b)|(?P<group>a))b(?P=group)~'; // fails $s = 'aba'; if (preg_match($p, $s, $m)) { var_dump($m); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/JXU6K
function name:  (null)
number of ops:  13
compiled vars:  !0 = $p, !1 = $s, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7E%28%3FJ%29%28z%3F%29%28%28%3F1%29%28%3FP%3Cgroup%3Eb%29%7C%28%3FP%3Cgroup%3Ea%29%29ba%7E'
    4     1        ASSIGN                                                   !0, '%7E%28%3FJ%29%28z%3F%29%28%28%3F1%29%28%3FP%3Cgroup%3Eb%29%7C%28%3FP%3Cgroup%3Ea%29%29b%28%3FP%3Dgroup%29%7E'
    5     2        ASSIGN                                                   !1, 'aba'
    8     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !2
          7        DO_ICALL                                         $6      
          8      > JMPZ                                                     $6, ->12
    9     9    >   INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   10    12    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.06 ms | 1385 KiB | 17 Q