3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'S1G5AB'; // given this $store = '5I6GAB'; // actually this $chars = explode('', $input); var_dump($chars); $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 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hBd7u
function name:  (null)
number of ops:  31
compiled vars:  !0 = $input, !1 = $store, !2 = $chars, !3 = $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                                               'explode'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    6     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
    7    10        INIT_FCALL                                               'str_replace'
         11        SEND_VAL                                                 <array>
         12        SEND_VAL                                                 <array>
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !3, $9
    8    16        ECHO                                                     !3
    9    17        INIT_FCALL                                               'preg_match'
         18        ROPE_INIT                                     3  ~12     '%2F'
         19        ROPE_ADD                                      1  ~12     ~12, !3
         20        ROPE_END                                      2  ~11     ~12, '%2F'
         21        SEND_VAL                                                 ~11
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $14     
         24        IS_SMALLER                                               0, $14
         25      > JMPZ                                                     ~15, ->28
         26    >   QM_ASSIGN                                        ~16     'Match'
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~16     'No+match'
         29    >   ECHO                                                     ~16
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153 ms | 1388 KiB | 21 Q