3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'S1G5AB'; // given this $store = '5I6GAB'; // actually this $regex = str_replace(['S','G','I'], ['[S5]', '[G6]', '[I1]'], $input); echo (0 < preg_match("/$regex/", $store) ? 'Match' : 'No match');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qWPiQ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $input, !1 = $store, !2 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'S1G5AB'
    3     1        ASSIGN                                                   !1, '5I6GAB'
    5     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 <array>
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
    6     8        INIT_FCALL                                               'preg_match'
          9        ROPE_INIT                                     3  ~8      '%2F'
         10        ROPE_ADD                                      1  ~8      ~8, !2
         11        ROPE_END                                      2  ~7      ~8, '%2F'
         12        SEND_VAL                                                 ~7
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $10     
         15        IS_SMALLER                                               0, $10
         16      > JMPZ                                                     ~11, ->19
         17    >   QM_ASSIGN                                        ~12     'Match'
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~12     'No+match'
         20    >   ECHO                                                     ~12
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.05 ms | 1386 KiB | 17 Q