3v4l.org

run code in 300+ PHP versions simultaneously
<?php $postal_code_to_check = substr('a0p1e0', 0, 3); $patterns = array( '[A]{1}[0]{1}[P-Z]{1}', '[A]{1}[2]{1}[V]{1}', '[G]{1}[0]{1}[G]{1}', '[G]{1}[4]{1}[T]{1}', '[R]{1}[0]{1}[B]{1}', ); $regex = "/^(" . implode('|', $patterns) . ")$/i"; if (preg_match($regex, $postal_code_to_check)) { print_f('Matched!'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/EdV7b
function name:  (null)
number of ops:  23
compiled vars:  !0 = $postal_code_to_check, !1 = $patterns, !2 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'substr'
          1        SEND_VAL                                                 'a0p1e0'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 3
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    3     6        ASSIGN                                                   !1, <array>
   10     7        INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 '%7C'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        CONCAT                                           ~7      '%2F%5E%28', $6
         12        CONCAT                                           ~8      ~7, '%29%24%2Fi'
         13        ASSIGN                                                   !2, ~8
   11    14        INIT_FCALL                                               'preg_match'
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $10     
         18      > JMPZ                                                     $10, ->22
   12    19    >   INIT_FCALL_BY_NAME                                       'print_f'
         20        SEND_VAL_EX                                              'Matched%21'
         21        DO_FCALL                                      0          
   13    22    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.54 ms | 1386 KiB | 19 Q