3v4l.org

run code in 500+ PHP versions simultaneously
<?php $map = [ 'BACK PACK BBP160800103 G086-1 8#.JPG', 'BACKPACK BBP160500010 G114-3#1.JPG', 'WSL160800024-WSL160800025 L83-5.JPG', 'bogey', 'IA041017 L83-5.JPG' ]; $result = []; foreach ($map as $string) { array_push($result, ...preg_match_all('/\b(?:BBP|WSL|IA)\d{6,9}\b/', $string, $m) ? $m[0] : []); } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/SjO2O
function name:  (null)
number of ops:  25
compiled vars:  !0 = $map, !1 = $result, !2 = $string, !3 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, <array>
   12     2      > FE_RESET_R                                           $6      !0, ->20
          3    > > FE_FETCH_R                                                   $6, !2, ->20
   13     4    >   INIT_FCALL                                                   'array_push'
          5        SEND_REF                                                     !1
          6        INIT_FCALL                                                   'preg_match_all'
          7        SEND_VAL                                                     '%2F%5Cb%28%3F%3ABBP%7CWSL%7CIA%29%5Cd%7B6%2C9%7D%5Cb%2F'
          8        SEND_VAR                                                     !2
          9        SEND_REF                                                     !3
         10        DO_ICALL                                             $7      
         11      > JMPZ                                                         $7, ->15
         12    >   FETCH_DIM_R                                          ~8      !3, 0
         13        QM_ASSIGN                                            ~9      ~8
         14      > JMP                                                          ->16
         15    >   QM_ASSIGN                                            ~9      <array>
         16    >   SEND_UNPACK                                                  ~9
         17        CHECK_UNDEF_ARGS                                             
         18        DO_ICALL                                                     
   12    19      > JMP                                                          ->3
         20    >   FE_FREE                                                      $6
   15    21        INIT_FCALL                                                   'var_export'
         22        SEND_VAR                                                     !1
         23        DO_ICALL                                                     
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
132.51 ms | 481 KiB | 10 Q