3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '@mention_1 @$badmention Manual balls knit cardigan @120rb email me @ example@example.com'; $count = preg_match_all( '/(?:^|\s)@\K\w+/', $string, $matches ); var_export([ 'count' => $count, 'matches' => $matches[0] ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DnbhW
function name:  (null)
number of ops:  14
compiled vars:  !0 = $string, !1 = $count, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%40mention_1+%40%24badmention+Manual+balls+knit+cardigan+%40120rb%0Aemail+me+%40+example%40example.com'
    6     1        INIT_FCALL                                               'preg_match_all'
    7     2        SEND_VAL                                                 '%2F%28%3F%3A%5E%7C%5Cs%29%40%5CK%5Cw%2B%2F'
    8     3        SEND_VAR                                                 !0
    9     4        SEND_REF                                                 !2
    6     5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   12     7        INIT_FCALL                                               'var_export'
   13     8        INIT_ARRAY                                       ~6      !1, 'count'
   14     9        FETCH_DIM_R                                      ~7      !2, 0
         10        ADD_ARRAY_ELEMENT                                ~6      ~7, 'matches'
         11        SEND_VAL                                                 ~6
   12    12        DO_ICALL                                                 
   15    13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.77 ms | 997 KiB | 15 Q