3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array( '0' => Array('id' => '5', 'class' => 'A'), '1' => Array('id' => '53', 'class' => 'B'), '2' => Array('id' => '2', 'class' => 'C'), ); foreach ($array as $key => $values) { $array[$key]['description'] = 'dadadadad'; if ($values['class'] == 'B') { $array = array_intersect_key($array, array_flip(Array($key))); } } print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/lfKVr
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $values, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $4      !0, ->20
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->20
          3    >   ASSIGN                                                   !2, ~5
   10     4        FETCH_DIM_W                                      $7      !0, !2
          5        ASSIGN_DIM                                               $7, 'description'
          6        OP_DATA                                                  'dadadadad'
   11     7        FETCH_DIM_R                                      ~9      !1, 'class'
          8        IS_EQUAL                                                 ~9, 'B'
          9      > JMPZ                                                     ~10, ->19
   12    10    >   INIT_FCALL                                               'array_intersect_key'
         11        SEND_VAR                                                 !0
         12        INIT_FCALL                                               'array_flip'
         13        INIT_ARRAY                                       ~11     !2
         14        SEND_VAL                                                 ~11
         15        DO_ICALL                                         $12     
         16        SEND_VAR                                                 $12
         17        DO_ICALL                                         $13     
         18        ASSIGN                                                   !0, $13
    9    19    > > JMP                                                      ->2
         20    >   FE_FREE                                                  $4
   16    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.28 ms | 1387 KiB | 19 Q