3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.73 ms | 1401 KiB | 21 Q