3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("report" => array( "JobDept" => "FEA", "JobBranch" => "AAL", "Destination" => "TWTPE", ), ); $replace = [ "JobDept" => "department", "JobBranch" => "branch", "Destination" => "destination", ]; $new_array = []; foreach ($array as $k => $v) { $new_array[$replace[$k]] = $v; } print_r($new_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/ObBh0
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array, !1 = $replace, !2 = $new_array, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   16     2        ASSIGN                                                   !2, <array>
   17     3      > FE_RESET_R                                       $8      !0, ->10
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->10
          5    >   ASSIGN                                                   !4, ~9
   18     6        FETCH_DIM_R                                      ~11     !1, !4
          7        ASSIGN_DIM                                               !2, ~11
          8        OP_DATA                                                  !3
   17     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $8
   20    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.83 ms | 1004 KiB | 14 Q