3v4l.org

run code in 500+ PHP versions simultaneously
<?php $first = [ 3 => [['id' => 1, 'number' => 0, 'time' => 40,]], 4 => [['id' => 2, 'number' => 0, 'time' => 40,]], 5 => [['id' => 3, 'number' => 0, 'time' => 40,]], 6 => [['id' => 1, 'number' => 0, 'time' => 41,]], 7 => [['id' => 2, 'number' => 0, 'time' => 41,]], 8 => [['id' => 3, 'number' => 0, 'time' => 41,]], ]; $second = [ 3 => ['id' => '1', 'number' => '3785', 'time' => '40'], 4 => ['id' => '2', 'number' => '1574', 'time' => '40'], 5 => ['id' => '1', 'number' => '2954', 'time' => '41'], 6 => ['id' => '2', 'number' => '2463', 'time' => '41'], ]; $map = []; foreach ($first as $k => [['id' => $id, 'time' => $time]]) { $map["{$id}_{$time}"] = $k; } foreach ($second as $row) { $key = $map["{$row['id']}_{$row['time']}"]; $first[$key] = $row; } var_export($first);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 32
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 32
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 19
filename:       /in/V4sUS
function name:  (null)
number of ops:  37
compiled vars:  !0 = $first, !1 = $second, !2 = $map, !3 = $id, !4 = $time, !5 = $k, !6 = $row, !7 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1        ASSIGN                                                       !1, <array>
   19     2        ASSIGN                                                       !2, <array>
   20     3      > FE_RESET_R                                           $11     !0, ->19
          4    > > FE_FETCH_R                                           ~18     $11, $12, ->19
          5    >   FETCH_LIST_R                                         $13     $12, 0
          6        FETCH_LIST_R                                         $14     $13, 'id'
          7        ASSIGN                                                       !3, $14
          8        FETCH_LIST_R                                         $16     $13, 'time'
          9        ASSIGN                                                       !4, $16
         10        FREE                                                         $13
         11        FREE                                                         $12
         12        ASSIGN                                                       !5, ~18
   21    13        ROPE_INIT                                         3  ~21     !3
         14        ROPE_ADD                                          1  ~21     ~21, '_'
         15        ROPE_END                                          2  ~20     ~21, !4
         16        ASSIGN_DIM                                                   !2, ~20
         17        OP_DATA                                                      !5
   20    18      > JMP                                                          ->4
         19    >   FE_FREE                                                      $11
   24    20      > FE_RESET_R                                           $24     !1, ->32
         21    > > FE_FETCH_R                                                   $24, !6, ->32
   25    22    >   FETCH_DIM_R                                          ~25     !6, 'id'
         23        ROPE_INIT                                         3  ~28     ~25
         24        ROPE_ADD                                          1  ~28     ~28, '_'
         25        FETCH_DIM_R                                          ~26     !6, 'time'
         26        ROPE_END                                          2  ~27     ~28, ~26
         27        FETCH_DIM_R                                          ~30     !2, ~27
         28        ASSIGN                                                       !7, ~30
   26    29        ASSIGN_DIM                                                   !0, !7
         30        OP_DATA                                                      !6
   24    31      > JMP                                                          ->21
         32    >   FE_FREE                                                      $24
   28    33        INIT_FCALL                                                   'var_export'
         34        SEND_VAR                                                     !0
         35        DO_ICALL                                                     
         36      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.4 ms | 1989 KiB | 14 Q