3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "cricket-ck-game-play", "hand-ball-hb-game-play", "volley-ball-vb-game-play", "soccer-sc-game-play" ]; $pattern = "/\b(\w{3,}(?:-(?:\w{3,}))*)-(\w{2})-game-play\b/"; foreach ($strings as $str) { preg_match($pattern, $str, $matches); print_r($matches); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/5oMPE
function name:  (null)
number of ops:  15
compiled vars:  !0 = $strings, !1 = $pattern, !2 = $str, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, '%2F%5Cb%28%5Cw%7B3%2C%7D%28%3F%3A-%28%3F%3A%5Cw%7B3%2C%7D%29%29%2A%29-%28%5Cw%7B2%7D%29-game-play%5Cb%2F'
   12     2      > FE_RESET_R                                       $6      !0, ->13
          3    > > FE_FETCH_R                                               $6, !2, ->13
   13     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !3
          8        DO_ICALL                                                 
   14     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                                 
   12    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $6
   15    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.38 ms | 953 KiB | 15 Q