3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = [ "This is a (first) test with the first hit", "This is a (first] test with the first hit" ]; foreach ($strings as $str) { preg_match( '/(?:\(first\)|\[first]|{first})(*SKIP)(*FAIL)|\bfirst\b/', $str, $matches, PREG_OFFSET_CAPTURE); print_r($matches); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/pTLGH
function name:  (null)
number of ops:  15
compiled vars:  !0 = $strings, !1 = $str, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    8     1      > FE_RESET_R                                           $4      !0, ->13
          2    > > FE_FETCH_R                                                   $4, !1, ->13
    9     3    >   INIT_FCALL                                                   'preg_match'
   10     4        SEND_VAL                                                     '%2F%28%3F%3A%5C%28first%5C%29%7C%5C%5Bfirst%5D%7C%7Bfirst%7D%29%28%2ASKIP%29%28%2AFAIL%29%7C%5Cbfirst%5Cb%2F'
   11     5        SEND_VAR                                                     !1
   12     6        SEND_REF                                                     !2
   13     7        SEND_VAL                                                     256
    9     8        DO_ICALL                                                     
   14     9        INIT_FCALL                                                   'print_r'
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                                     
    8    12      > JMP                                                          ->2
         13    >   FE_FREE                                                      $4
   15    14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.75 ms | 2140 KiB | 15 Q