3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'There are stores attached: Store1 (Detached) **28876.Mazon** (Detached) 28455.Targo (Detached) 28389.Walmo (Detached)'; foreach (['Mazon', 'Targo', 'Walmo', 'Foo'] as $needle) { printf( "%s => %s\n", $needle, preg_match('#\d+(?=\.' . preg_quote($needle) . ')#', $haystack, $m) ? $m[0] : 'no match' ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 24
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/Q8ofF
function name:  (null)
number of ops:  26
compiled vars:  !0 = $haystack, !1 = $needle, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'There+are+stores+attached%3A+Store1+%28Detached%29+%2A%2A28876.Mazon%2A%2A+%28Detached%29+28455.Targo+%28Detached%29+28389.Walmo+%28Detached%29'
    5     1      > FE_RESET_R                                       $4      <array>, ->24
          2    > > FE_FETCH_R                                               $4, !1, ->24
    6     3    >   INIT_FCALL                                               'printf'
    7     4        SEND_VAL                                                 '%25s+%3D%3E+%25s%0A'
    8     5        SEND_VAR                                                 !1
    9     6        INIT_FCALL                                               'preg_match'
          7        INIT_FCALL                                               'preg_quote'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        CONCAT                                           ~6      '%23%5Cd%2B%28%3F%3D%5C.', $5
         11        CONCAT                                           ~7      ~6, '%29%23'
         12        SEND_VAL                                                 ~7
         13        SEND_VAR                                                 !0
         14        SEND_REF                                                 !2
         15        DO_ICALL                                         $8      
         16      > JMPZ                                                     $8, ->20
         17    >   FETCH_DIM_R                                      ~9      !2, 0
         18        QM_ASSIGN                                        ~10     ~9
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~10     'no+match'
         21    >   SEND_VAL                                                 ~10
    6    22        DO_ICALL                                                 
    5    23      > JMP                                                      ->2
         24    >   FE_FREE                                                  $4
   11    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.09 ms | 1013 KiB | 16 Q