3v4l.org

run code in 300+ PHP versions simultaneously
<?php $e = array( "tracker1" => 'a1', 'tracker2' => 'a2', 'tracker3' => 'a3', 'tracker4' => 'a4', "tracker5" => 'a5', 'tracker6' => 'a6', 'tracker7' => 'a7', 'tracker8' => 'a8', 'tracker0' => 'a9', ); $carrier = "empty"; foreach($e as $key => $value){ if(strtolower(trim($value)) === strtolower(trim($carrier))){ //if match tracker[0-9], map. Else, keep going if(preg_match("/^tracker[0-9]/", $key)){ $carrier = $key; break; } } } echo $carrier."\n\n"; $carrier = "a3"; foreach($e as $key => $value){ if(strtolower(trim($value)) === strtolower(trim($carrier))){ //if match tracker[0-9], map. Else, keep going if(preg_match("/^tracker[0-9]/", $key)){ $carrier = $key; break; } } } echo $carrier."\n\n"; $carrier = "a8"; foreach($e as $key => $value){ if(strtolower(trim($value)) === strtolower(trim($carrier))){ //if match tracker[0-9], map. Else, keep going if(preg_match("/^tracker[0-9]/", $key)){ $carrier = $key; break; } } } echo $carrier."\n\n"; $carrier = "a9"; foreach($e as $key => $value){ if(strtolower(trim($value)) === strtolower(trim($carrier))){ //if match tracker[0-9], map. Else, keep going if(preg_match("/^tracker[0-9]/", $key)){ $carrier = $key; break; } } } echo $carrier."\n\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 56
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 56
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 55
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 77) Position 1 = 61, Position 2 = 85
Branch analysis from position: 61
2 jumps found. (Code = 78) Position 1 = 62, Position 2 = 85
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 84
Branch analysis from position: 77
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 84
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
2 jumps found. (Code = 77) Position 1 = 90, Position 2 = 114
Branch analysis from position: 90
2 jumps found. (Code = 78) Position 1 = 91, Position 2 = 114
Branch analysis from position: 91
2 jumps found. (Code = 43) Position 1 = 106, Position 2 = 113
Branch analysis from position: 106
2 jumps found. (Code = 43) Position 1 = 111, Position 2 = 113
Branch analysis from position: 111
1 jumps found. (Code = 42) Position 1 = 114
Branch analysis from position: 114
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 113
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
Branch analysis from position: 113
Branch analysis from position: 114
Branch analysis from position: 114
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 84
Branch analysis from position: 85
Branch analysis from position: 85
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 55
Branch analysis from position: 56
Branch analysis from position: 56
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 26
Branch analysis from position: 27
Branch analysis from position: 27
filename:       /in/j5U7T
function name:  (null)
number of ops:  118
compiled vars:  !0 = $e, !1 = $carrier, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, 'empty'
   21     2      > FE_RESET_R                                       $6      !0, ->27
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->27
          4    >   ASSIGN                                                   !3, ~7
   22     5        INIT_FCALL                                               'strtolower'
          6        INIT_FCALL                                               'trim'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9        SEND_VAR                                                 $9
         10        DO_ICALL                                         $10     
         11        INIT_FCALL                                               'strtolower'
         12        INIT_FCALL                                               'trim'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $11     
         15        SEND_VAR                                                 $11
         16        DO_ICALL                                         $12     
         17        IS_IDENTICAL                                             $10, $12
         18      > JMPZ                                                     ~13, ->26
   24    19    >   INIT_FCALL                                               'preg_match'
         20        SEND_VAL                                                 '%2F%5Etracker%5B0-9%5D%2F'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $14     
         23      > JMPZ                                                     $14, ->26
   25    24    >   ASSIGN                                                   !1, !3
   26    25      > JMP                                                      ->27
   21    26    > > JMP                                                      ->3
         27    >   FE_FREE                                                  $6
   31    28        CONCAT                                           ~16     !1, '%0A%0A'
         29        ECHO                                                     ~16
   35    30        ASSIGN                                                   !1, 'a3'
   39    31      > FE_RESET_R                                       $18     !0, ->56
         32    > > FE_FETCH_R                                       ~19     $18, !2, ->56
         33    >   ASSIGN                                                   !3, ~19
   40    34        INIT_FCALL                                               'strtolower'
         35        INIT_FCALL                                               'trim'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $21     
         38        SEND_VAR                                                 $21
         39        DO_ICALL                                         $22     
         40        INIT_FCALL                                               'strtolower'
         41        INIT_FCALL                                               'trim'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                         $23     
         44        SEND_VAR                                                 $23
         45        DO_ICALL                                         $24     
         46        IS_IDENTICAL                                             $22, $24
         47      > JMPZ                                                     ~25, ->55
   42    48    >   INIT_FCALL                                               'preg_match'
         49        SEND_VAL                                                 '%2F%5Etracker%5B0-9%5D%2F'
         50        SEND_VAR                                                 !3
         51        DO_ICALL                                         $26     
         52      > JMPZ                                                     $26, ->55
   43    53    >   ASSIGN                                                   !1, !3
   44    54      > JMP                                                      ->56
   39    55    > > JMP                                                      ->32
         56    >   FE_FREE                                                  $18
   49    57        CONCAT                                           ~28     !1, '%0A%0A'
         58        ECHO                                                     ~28
   55    59        ASSIGN                                                   !1, 'a8'
   59    60      > FE_RESET_R                                       $30     !0, ->85
         61    > > FE_FETCH_R                                       ~31     $30, !2, ->85
         62    >   ASSIGN                                                   !3, ~31
   60    63        INIT_FCALL                                               'strtolower'
         64        INIT_FCALL                                               'trim'
         65        SEND_VAR                                                 !2
         66        DO_ICALL                                         $33     
         67        SEND_VAR                                                 $33
         68        DO_ICALL                                         $34     
         69        INIT_FCALL                                               'strtolower'
         70        INIT_FCALL                                               'trim'
         71        SEND_VAR                                                 !1
         72        DO_ICALL                                         $35     
         73        SEND_VAR                                                 $35
         74        DO_ICALL                                         $36     
         75        IS_IDENTICAL                                             $34, $36
         76      > JMPZ                                                     ~37, ->84
   62    77    >   INIT_FCALL                                               'preg_match'
         78        SEND_VAL                                                 '%2F%5Etracker%5B0-9%5D%2F'
         79        SEND_VAR                                                 !3
         80        DO_ICALL                                         $38     
         81      > JMPZ                                                     $38, ->84
   63    82    >   ASSIGN                                                   !1, !3
   64    83      > JMP                                                      ->85
   59    84    > > JMP                                                      ->61
         85    >   FE_FREE                                                  $30
   69    86        CONCAT                                           ~40     !1, '%0A%0A'
         87        ECHO                                                     ~40
   75    88        ASSIGN                                                   !1, 'a9'
   79    89      > FE_RESET_R                                       $42     !0, ->114
         90    > > FE_FETCH_R                                       ~43     $42, !2, ->114
         91    >   ASSIGN                                                   !3, ~43
   80    92        INIT_FCALL                                               'strtolower'
         93        INIT_FCALL                                               'trim'
         94        SEND_VAR                                                 !2
         95        DO_ICALL                                         $45     
         96        SEND_VAR                                                 $45
         97        DO_ICALL                                         $46     
         98        INIT_FCALL                                               'strtolower'
         99        INIT_FCALL                                               'trim'
        100        SEND_VAR                                                 !1
        101        DO_ICALL                                         $47     
        102        SEND_VAR                                                 $47
        103        DO_ICALL                                         $48     
        104        IS_IDENTICAL                                             $46, $48
        105      > JMPZ                                                     ~49, ->113
   82   106    >   INIT_FCALL                                               'preg_match'
        107        SEND_VAL                                                 '%2F%5Etracker%5B0-9%5D%2F'
        108        SEND_VAR                                                 !3
        109        DO_ICALL                                         $50     
        110      > JMPZ                                                     $50, ->113
   83   111    >   ASSIGN                                                   !1, !3
   84   112      > JMP                                                      ->114
   79   113    > > JMP                                                      ->90
        114    >   FE_FREE                                                  $42
   89   115        CONCAT                                           ~52     !1, '%0A%0A'
        116        ECHO                                                     ~52
        117      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.77 ms | 1408 KiB | 19 Q