3v4l.org

run code in 300+ PHP versions simultaneously
<?php $map = [ 'club' => [ 'fr' => 1, 'de' => 2, 'pl' => 3, ], 'shop' => [ 'de' => 10, ], ]; //foreach ($map as $context => $value) { // $result = array_flip($value); // if (isset($result[10]) && $context === 'shop') { // echo 'shop'; // return; // } //} //echo 'club'; foreach ($map as $context => $value) { if (in_array(10, $value)) { if ($context === 'shop') { echo 'shop'; return; } } } echo 'club';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/5Qujf
function name:  (null)
number of ops:  18
compiled vars:  !0 = $map, !1 = $value, !2 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   24     1      > FE_RESET_R                                       $4      !0, ->15
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->15
          3    >   ASSIGN                                                   !2, ~5
   25     4        INIT_FCALL                                               'in_array'
          5        SEND_VAL                                                 10
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8      > JMPZ                                                     $7, ->14
   26     9    >   IS_IDENTICAL                                             !2, 'shop'
         10      > JMPZ                                                     ~8, ->14
   27    11    >   ECHO                                                     'shop'
   28    12        FE_FREE                                                  $4
         13      > RETURN                                                   null
   24    14    > > JMP                                                      ->2
         15    >   FE_FREE                                                  $4
   32    16        ECHO                                                     'club'
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.98 ms | 1395 KiB | 15 Q