3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ '5,422 Comments, other text here and stuff', '2 Comments, not great!', '4/4/2009 21 Comments', 'This one is a whopper: 1,234,567,890 Comments' ]; foreach ($strings as $string) { echo preg_match('~\d{1,3}(?:,\d{3})*(?= Comments)~', $string, $m) ? $m[0] : 'no match'; echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/WC5Lv
function name:  (null)
number of ops:  18
compiled vars:  !0 = $strings, !1 = $string, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1      > FE_RESET_R                                       $4      !0, ->16
          2    > > FE_FETCH_R                                               $4, !1, ->16
   11     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%7E%5Cd%7B1%2C3%7D%28%3F%3A%2C%5Cd%7B3%7D%29%2A%28%3F%3D+Comments%29%7E'
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !2
          7        DO_ICALL                                         $5      
          8      > JMPZ                                                     $5, ->12
          9    >   FETCH_DIM_R                                      ~6      !2, 0
         10        QM_ASSIGN                                        ~7      ~6
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~7      'no+match'
         13    >   ECHO                                                     ~7
   12    14        ECHO                                                     '%0A'
   10    15      > JMP                                                      ->2
         16    >   FE_FREE                                                  $4
   13    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.5 ms | 1406 KiB | 15 Q