3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regexp = '/^V[ABC][1-5][0-9]?$/'; $tests = array( 'VA1','VA54','VB26','VC26', 'V25','VA66','VD26','VAA24','22', ); foreach($tests as $t) { var_dump("$t -> ".preg_match($regexp, $t)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/I4J3c
function name:  (null)
number of ops:  17
compiled vars:  !0 = $regexp, !1 = $tests, !2 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2F%5EV%5BABC%5D%5B1-5%5D%5B0-9%5D%3F%24%2F'
    3     1        ASSIGN                                                   !1, <array>
    7     2      > FE_RESET_R                                       $5      !1, ->15
          3    > > FE_FETCH_R                                               $5, !2, ->15
    8     4    >   INIT_FCALL                                               'var_dump'
          5        NOP                                                      
          6        FAST_CONCAT                                      ~6      !2, '+-%3E+'
          7        INIT_FCALL                                               'preg_match'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $7      
         11        CONCAT                                           ~8      ~6, $7
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                                 
    7    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $5
    9    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.91 ms | 1395 KiB | 17 Q