3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "12-blog/", "12-blog/blog2/", "en/12-blog/", "en/12-blog/blog2/" ]; $pattern = '~^(?:en/)?\d{1,3}-[^/]+/$~'; foreach ($strings as $str) { if (preg_match($pattern, $str)) { echo "Match for $str" . PHP_EOL; } else { echo "No match for $str" . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/DpbTI
function name:  (null)
number of ops:  21
compiled vars:  !0 = $strings, !1 = $pattern, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, '%7E%5E%28%3F%3Aen%2F%29%3F%5Cd%7B1%2C3%7D-%5B%5E%2F%5D%2B%2F%24%7E'
   10     2      > FE_RESET_R                                       $5      !0, ->19
          3    > > FE_FETCH_R                                               $5, !2, ->19
   11     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8      > JMPZ                                                     $6, ->14
   12     9    >   NOP                                                      
         10        FAST_CONCAT                                      ~7      'Match+for+', !2
         11        CONCAT                                           ~8      ~7, '%0A'
         12        ECHO                                                     ~8
   11    13      > JMP                                                      ->18
   14    14    >   NOP                                                      
         15        FAST_CONCAT                                      ~9      'No+match+for+', !2
         16        CONCAT                                           ~10     ~9, '%0A'
         17        ECHO                                                     ~10
   10    18    > > JMP                                                      ->3
         19    >   FE_FREE                                                  $5
   16    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.03 ms | 1010 KiB | 14 Q