3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '/(?J)TXT(?<number>[0-9]+)|(?<number>[0-9]+)TXT/'; if (preg_match_all($regex, "TXT123 and 456TXT1", $matches, PREG_SET_ORDER, 0)) { foreach ($matches as $m) { echo $m["number"] . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 16
filename:       /in/4MHGa
function name:  (null)
number of ops:  17
compiled vars:  !0 = $regex, !1 = $matches, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%28%3FJ%29TXT%28%3F%3Cnumber%3E%5B0-9%5D%2B%29%7C%28%3F%3Cnumber%3E%5B0-9%5D%2B%29TXT%2F'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'TXT123+and+456TXT1'
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        SEND_VAL                                                 0
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->16
    5     9    > > FE_RESET_R                                       $5      !1, ->15
         10    > > FE_FETCH_R                                               $5, !2, ->15
    6    11    >   FETCH_DIM_R                                      ~6      !2, 'number'
         12        CONCAT                                           ~7      ~6, '%0A'
         13        ECHO                                                     ~7
    5    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $5
    8    16    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.59 ms | 1426 KiB | 14 Q