3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "PHP [gallery-1]. [gallery-2]"; if (preg_match_all("/\bgallery-\b/i", $text, $matches, PREG_OFFSET_CAPTURE)) { print_r($matches); foreach($match as $matches) { print_r($match); } // $position = $matches[0][0][1]; } else { echo "A match was not found."; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D7SD0
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $matches, !2 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'PHP+%5Bgallery-1%5D.+%5Bgallery-2%5D'
    5     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5Cbgallery-%5Cb%2Fi'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 256
          6        DO_ICALL                                         $4      
          7      > JMPZ                                                     $4, ->19
    6     8    >   INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
    8    11      > FE_RESET_R                                       $6      !2, ->17
         12    > > FE_FETCH_R                                               $6, !1, ->17
   10    13    >   INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
    8    16      > JMP                                                      ->12
         17    >   FE_FREE                                                  $6
         18      > JMP                                                      ->20
   15    19    >   ECHO                                                     'A+match+was+not+found.'
   16    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.62 ms | 1395 KiB | 17 Q