3v4l.org

run code in 300+ PHP versions simultaneously
<?php $givenArray = [ 'destination' => [ 'London', 'Liverpool', 'Nottingham', 'Oxford', ], 'fee' => [ 10, 15, 20, 25 ], ]; $output = []; foreach ($givenArray['destination'] as $key => $destination) { $fee = $givenArray['fee'][$key]; $output[] = [ 'destination' => $destination, 'fee' => $fee, 'status' => 1, ]; } print_r($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/004PF
function name:  (null)
number of ops:  20
compiled vars:  !0 = $givenArray, !1 = $output, !2 = $destination, !3 = $key, !4 = $fee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   19     1        ASSIGN                                                   !1, <array>
   20     2        FETCH_DIM_R                                      ~7      !0, 'destination'
          3      > FE_RESET_R                                       $8      ~7, ->15
          4    > > FE_FETCH_R                                       ~9      $8, !2, ->15
          5    >   ASSIGN                                                   !3, ~9
   21     6        FETCH_DIM_R                                      ~11     !0, 'fee'
          7        FETCH_DIM_R                                      ~12     ~11, !3
          8        ASSIGN                                                   !4, ~12
   24     9        INIT_ARRAY                                       ~15     !2, 'destination'
   25    10        ADD_ARRAY_ELEMENT                                ~15     !4, 'fee'
   26    11        ADD_ARRAY_ELEMENT                                ~15     1, 'status'
   23    12        ASSIGN_DIM                                               !1
   26    13        OP_DATA                                                  ~15
   20    14      > JMP                                                      ->4
         15    >   FE_FREE                                                  $8
   30    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.84 ms | 1004 KiB | 14 Q