3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lists = [['email' => 'test@test.lv', 'mvars' => ['name' => 'bob']],['email' => 'test@test.lv', 'mvars' => ['name' => 'bob']]]; foreach($lists as $list){ array_map(function($key){ var_dump($key); if($key == 'name'){ unset($key); $key = 'newkey'; } else { } },array_keys($list['mvars'])); return $list['mvars']; }; var_dump($lists);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/sMTSV
function name:  (null)
number of ops:  21
compiled vars:  !0 = $lists, !1 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $3      !0, ->16
          2    > > FE_FETCH_R                                               $3, !1, ->16
    6     3    >   INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsMTSV%3A6%240'
   14     5        SEND_VAL                                                 ~4
          6        INIT_FCALL                                               'array_keys'
          7        FETCH_DIM_R                                      ~5      !1, 'mvars'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                                 
   15    12        FETCH_DIM_R                                      ~8      !1, 'mvars'
         13        FE_FREE                                                  $3
         14      > RETURN                                                   ~8
    5    15*       JMP                                                      ->2
         16    >   FE_FREE                                                  $3
   18    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsMTSV%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/sMTSV
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    8     4        IS_EQUAL                                                 !0, 'name'
          5      > JMPZ                                                     ~2, ->9
    9     6    >   UNSET_CV                                                 !0
   10     7        ASSIGN                                                   !0, 'newkey'
          8      > JMP                                                      ->9
   14     9    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsMTSV%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.32 ms | 1396 KiB | 19 Q