3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = 'hello @tag1 111 world @tag2 @tag3 222 333'; if (preg_match('~(?<!\S)(@\S+|\d+)(?:\s+(?1))*(?=\s*$)~', $str, $m)) { echo $m[0]; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/Bag8r
function name:  (null)
number of ops:  10
compiled vars:  !0 = $str, !1 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'hello+%40tag1+111+world+%40tag2+%40tag3+222+333'
    4     1        INIT_FCALL                                                   'preg_match'
          2        SEND_VAL                                                     '%7E%28%3F%3C%21%5CS%29%28%40%5CS%2B%7C%5Cd%2B%29%28%3F%3A%5Cs%2B%28%3F1%29%29%2A%28%3F%3D%5Cs%2A%24%29%7E'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $3      
          6      > JMPZ                                                         $3, ->9
    5     7    >   FETCH_DIM_R                                          ~4      !1, 0
          8        ECHO                                                         ~4
    6     9    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.43 ms | 2015 KiB | 14 Q