3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "1111 2222 3333 4444 5555 6666"; if (preg_match_all('~(?:\G(?!^)\s?|\A(?=(?:\d{4}\s?)+\z))(\d{4})~', $str, $m)) { print_r($m[1]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/cGs6n
function name:  (null)
number of ops:  12
compiled vars:  !0 = $str, !1 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1111+2222+3333+4444+5555+6666'
    4     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%7E%28%3F%3A%5CG%28%3F%21%5E%29%5Cs%3F%7C%5CA%28%3F%3D%28%3F%3A%5Cd%7B4%7D%5Cs%3F%29%2B%5Cz%29%29%28%5Cd%7B4%7D%29%7E'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $3      
          6      > JMPZ                                                         $3, ->11
    5     7    >   INIT_FCALL                                                   'print_r'
          8        FETCH_DIM_R                                          ~4      !1, 1
          9        SEND_VAL                                                     ~4
         10        DO_ICALL                                                     
    6    11    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.47 ms | 2086 KiB | 15 Q