3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'num' => 1, 'name' => 'name 1', 'epg_channel_id' => 'ch111', 'added' => '1505435915', ], [ 'num' => 2, 'name' => 'name 2', 'epg_channel_id' => 'ch222', 'added' => '1505435915', ], [ 'num' => 3, 'name' => 'name 3', 'epg_channel_id' => 'ch333', 'added' => '1505435915', ], [ 'num' => 4, 'name' => 'name 4', 'epg_channel_id' => 'ch444', 'added' => '1505435915' ] ]; $array2 = [ ['ch000' => 'Um9jayBJbiBSaW8='], ['ch111' => 'Um9jayBJbiBSaW8='], ['ch222' => 'Um9jayBJbiBSaW8='], ['ch333' => 'Um9jayBJbiBSaW8='], ['ch444' => 'Um9jayBJbiBSaW8='] ]; $lookup = array_merge(...$array2); foreach ($array as &$row) { $row += [$row['epg_channel_id'] => $lookup[$row['epg_channel_id']]]; } var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/N1jDd
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $array2, !2 = $lookup, !3 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   29     1        ASSIGN                                                   !1, <array>
   37     2        INIT_FCALL                                               'array_merge'
          3        SEND_UNPACK                                              !1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   38     7      > FE_RESET_RW                                      $8      !0, ->15
          8    > > FE_FETCH_RW                                              $8, !3, ->15
   39     9    >   FETCH_DIM_R                                      ~9      !3, 'epg_channel_id'
         10        FETCH_DIM_R                                      ~10     !3, 'epg_channel_id'
         11        FETCH_DIM_R                                      ~11     !2, ~10
         12        INIT_ARRAY                                       ~12     ~11, ~9
         13        ASSIGN_OP                                     1          !3, ~12
   38    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $8
   41    16        INIT_FCALL                                               'var_export'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.35 ms | 1011 KiB | 15 Q