3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.56 ms | 1395 KiB | 17 Q