3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'Test' => 1, 'OtherKey' => 2, ); $keyTranslation = array( 'OtherKey' => 'other_key', 'Test' => 'test', ); function test(&$arr, $keyTranslation) { foreach ($arr as $key => $value) { var_dump(current($keyTranslation)); $arr["'".$keyTranslation[$key]."'"] = $value; unset($arr[$key]); } } test($arr, $keyTranslation);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B44K4
function name:  (null)
number of ops:  7
compiled vars:  !0 = $arr, !1 = $keyTranslation
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
   19     2        INIT_FCALL                                               'test'
          3        SEND_REF                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/B44K4
function name:  test
number of ops:  20
compiled vars:  !0 = $arr, !1 = $keyTranslation, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2      > FE_RESET_R                                       $4      !0, ->18
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->18
          4    >   ASSIGN                                                   !3, ~5
   13     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'current'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        SEND_VAR                                                 $7
         10        DO_ICALL                                                 
   14    11        FETCH_DIM_R                                      ~9      !1, !3
         12        CONCAT                                           ~10     '%27', ~9
         13        CONCAT                                           ~11     ~10, '%27'
         14        ASSIGN_DIM                                               !0, ~11
         15        OP_DATA                                                  !2
   16    16        UNSET_DIM                                                !0, !3
   12    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $4
   18    19      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.32 ms | 1399 KiB | 18 Q