3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inputs = [ 'd2.r1.4#100.37#1.9#2.3#1', 'd2.r1.4#100.37#1.9#2.38#1.8#22', 'd2.r1.4#100.37#1.9#2.3#1.12#2.30#2', ]; $pattern = '/^d[1-7]\.r[1-6](?:\.(?:3[0-7]|[12]\d|[1-9])#\d+)*$/i'; foreach ($inputs as $input) { echo "\n{$input}: "; var_export((bool)preg_match($pattern, $input)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/kQtAU
function name:  (null)
number of ops:  19
compiled vars:  !0 = $inputs, !1 = $pattern, !2 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, '%2F%5Ed%5B1-7%5D%5C.r%5B1-6%5D%28%3F%3A%5C.%28%3F%3A3%5B0-7%5D%7C%5B12%5D%5Cd%7C%5B1-9%5D%29%23%5Cd%2B%29%2A%24%2Fi'
   10     2      > FE_RESET_R                                       $5      !0, ->17
          3    > > FE_FETCH_R                                               $5, !2, ->17
   11     4    >   ROPE_INIT                                     3  ~7      '%0A'
          5        ROPE_ADD                                      1  ~7      ~7, !2
          6        ROPE_END                                      2  ~6      ~7, '%3A+'
          7        ECHO                                                     ~6
   12     8        INIT_FCALL                                               'var_export'
          9        INIT_FCALL                                               'preg_match'
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $9      
         13        BOOL                                             ~10     $9
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
   10    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $5
   13    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.27 ms | 1407 KiB | 17 Q