3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "ABwerty45^&*jk", "ABwerrtty", "LF%$^erftgt5234", "TABYR56H", "ab7877", "Abtyu7" ]; $arr = ['AB', 'DC', 'LF']; foreach ($strings as $string) { $match = in_array(substr($string, 0, 2), $arr); echo $match ? "Match: $string" . PHP_EOL : "No match: $string" . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 26
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 26
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/M5I2T
function name:  (null)
number of ops:  28
compiled vars:  !0 = $strings, !1 = $arr, !2 = $string, !3 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_R                                       $6      !0, ->26
          3    > > FE_FETCH_R                                               $6, !2, ->26
   14     4    >   INIT_FCALL                                               'in_array'
          5        INIT_FCALL                                               'substr'
          6        SEND_VAR                                                 !2
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !3, $8
   15    14      > JMPZ                                                     !3, ->20
         15    >   NOP                                                      
         16        FAST_CONCAT                                      ~10     'Match%3A+', !2
         17        CONCAT                                           ~11     ~10, '%0A'
         18        QM_ASSIGN                                        ~12     ~11
         19      > JMP                                                      ->24
         20    >   NOP                                                      
         21        FAST_CONCAT                                      ~13     'No+match%3A+', !2
         22        CONCAT                                           ~14     ~13, '%0A'
         23        QM_ASSIGN                                        ~12     ~14
         24    >   ECHO                                                     ~12
   13    25      > JMP                                                      ->3
         26    >   FE_FREE                                                  $6
   16    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.8 ms | 1401 KiB | 17 Q