3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = [ "[Call xyz" => [ "features" => [ [ "name" => "Display", "display" => "web" ], [ "name" => "Forwarding", "display" => "web" ], [ "name" => "Test", "display" => "web" ] ] ], "[Hidden]" => [ "features" => [ [ "name" => "Display", "display" => "web" ], [ "name" => "Forwarding", "display" => "web" ], [ "name" => "Test", "display" => "web" ] ] ] ]; $index = 1; foreach ($arrays as &$array) { if (array_key_exists($index, $array["features"]) && ($array["features"][$index]["name"] === "Display" || $array["features"][$index]["name"] === "Forwarding") ) { $array["features"][$index]["checked"] = 1; } } print_r($arrays);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
Branch analysis from position: 17
Branch analysis from position: 18
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/v5C2r
function name:  (null)
number of ops:  29
compiled vars:  !0 = $arrays, !1 = $index, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   38     1        ASSIGN                                                   !1, 1
   39     2      > FE_RESET_RW                                      $5      !0, ->24
          3    > > FE_FETCH_RW                                              $5, !2, ->24
   40     4    >   FETCH_DIM_R                                      ~6      !2, 'features'
          5        ARRAY_KEY_EXISTS                                 ~7      !1, ~6
          6      > JMPZ_EX                                          ~7      ~7, ->18
   41     7    >   FETCH_DIM_R                                      ~8      !2, 'features'
          8        FETCH_DIM_R                                      ~9      ~8, !1
          9        FETCH_DIM_R                                      ~10     ~9, 'name'
         10        IS_IDENTICAL                                     ~11     ~10, 'Display'
         11      > JMPNZ_EX                                         ~11     ~11, ->17
         12    >   FETCH_DIM_R                                      ~12     !2, 'features'
         13        FETCH_DIM_R                                      ~13     ~12, !1
         14        FETCH_DIM_R                                      ~14     ~13, 'name'
         15        IS_IDENTICAL                                     ~15     ~14, 'Forwarding'
         16        BOOL                                             ~11     ~15
         17    >   BOOL                                             ~7      ~11
         18    > > JMPZ                                                     ~7, ->23
   43    19    >   FETCH_DIM_W                                      $16     !2, 'features'
         20        FETCH_DIM_W                                      $17     $16, !1
         21        ASSIGN_DIM                                               $17, 'checked'
         22        OP_DATA                                                  1
   39    23    > > JMP                                                      ->3
         24    >   FE_FREE                                                  $5
   47    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
226.63 ms | 999 KiB | 14 Q