3v4l.org

run code in 500+ PHP versions simultaneously
<?php $zip_codes = array( '12556', '765547', '234*', '987*' ); $target_zip = '2347890'; foreach($zip_codes as $zip){ if(strpos($zip, "*") !== false){ if(substr($zip, 0, -1) == substr($target_zip, 0, strlen($zip)-1)){ echo "wildcard match"; } }else{ if($zip == $target_zip){ echo "excat match"; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/hIGER
function name:  (null)
number of ops:  23
compiled vars:  !0 = $zip_codes, !1 = $target_zip, !2 = $zip
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, '2347890'
    7     2      > FE_RESET_R                                           $5      !0, ->21
          3    > > FE_FETCH_R                                                   $5, !2, ->21
    8     4    >   FRAMELESS_ICALL_2                strpos              ~6      !2, '%2A'
          5        TYPE_CHECK                                      1018          ~6
          6      > JMPZ                                                         ~7, ->17
    9     7    >   FRAMELESS_ICALL_3                substr              ~8      !2, 0
          8        OP_DATA                                                      -1
          9        STRLEN                                               ~9      !2
         10        SUB                                                  ~10     ~9, 1
         11        FRAMELESS_ICALL_3                substr              ~11     !1, 0
         12        OP_DATA                                                      ~10
         13        IS_EQUAL                                                     ~8, ~11
         14      > JMPZ                                                         ~12, ->16
   10    15    >   ECHO                                                         'wildcard+match'
    8    16    > > JMP                                                          ->20
   13    17    >   IS_EQUAL                                                     !2, !1
         18      > JMPZ                                                         ~13, ->20
   14    19    >   ECHO                                                         'excat+match'
    7    20    > > JMP                                                          ->3
         21    >   FE_FREE                                                      $5
   17    22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.65 ms | 2176 KiB | 13 Q