3v4l.org

run code in 300+ PHP versions simultaneously
<?php $links = [ "https://www.facebook.com/tr?id=13046212397316299911&amp;ev=pageview&amp;noscript=1", "https://www.facebook.com/pages/something", "https://www.facebook.com/groups/something/", "https://www.facebook.com/something" ]; $pattern = '~^https://www\.facebook\.[a-z.]+/(?:pages/|groups/)?[\w-]+/?$~'; foreach ($links as $link) { if ($matchesFound = preg_match($pattern, $link, $matches)) { if ($matchesFound) { print_r($matches[0] . PHP_EOL); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/MOgm3
function name:  (null)
number of ops:  20
compiled vars:  !0 = $links, !1 = $pattern, !2 = $link, !3 = $matchesFound, !4 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, '%7E%5Ehttps%3A%2F%2Fwww%5C.facebook%5C.%5Ba-z.%5D%2B%2F%28%3F%3Apages%2F%7Cgroups%2F%29%3F%5B%5Cw-%5D%2B%2F%3F%24%7E'
   11     2      > FE_RESET_R                                       $7      !0, ->18
          3    > > FE_FETCH_R                                               $7, !2, ->18
   12     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !4
          8        DO_ICALL                                         $8      
          9        ASSIGN                                           ~9      !3, $8
         10      > JMPZ                                                     ~9, ->17
   13    11    > > JMPZ                                                     !3, ->17
   14    12    >   INIT_FCALL                                               'print_r'
         13        FETCH_DIM_R                                      ~10     !4, 0
         14        CONCAT                                           ~11     ~10, '%0A'
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                                 
   11    17    > > JMP                                                      ->3
         18    >   FE_FREE                                                  $7
   17    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.89 ms | 1011 KiB | 15 Q