3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = [ ['v' => '13', 't' => '2015-09-08 18:50:00'], ['v' => '25', 't' => '2015-09-08 19:00:00'], ['v' => '34', 't' => '2015-09-08 19:05:00'], ['v' => '24', 't' => '2015-09-08 19:10:00'] ]; $a2 = [ ['v' => '10', 't' => '2015-09-08 18:50:00'], ['v' => '29', 't' => '2015-09-08 18:55:00'], ['v' => '17', 't' => '2015-09-08 19:00:00'] ]; $result =[]; foreach ($a1 as $row) { $result[$row['t']] = [ 'v1' => $row['v'], 'v2' => null, 't' => $row['t'] ]; } foreach ($a2 as $row) { if (isset($result[$row['t']])) { $result[$row['t']]['v2'] = $row['v']; } else { $result[$row['t']] = [ 'v1' => null, 'v2' => $row['v'], 't' => $row['t'] ]; } } ksort($result); var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 35
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 35
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 14
filename:       /in/HhF63
function name:  (null)
number of ops:  46
compiled vars:  !0 = $a1, !1 = $a2, !2 = $result, !3 = $row
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                                       $7      !0, ->14
          4    > > FE_FETCH_R                                               $7, !3, ->14
   18     5    >   FETCH_DIM_R                                      ~8      !3, 't'
   19     6        FETCH_DIM_R                                      ~10     !3, 'v'
          7        INIT_ARRAY                                       ~11     ~10, 'v1'
          8        ADD_ARRAY_ELEMENT                                ~11     null, 'v2'
   21     9        FETCH_DIM_R                                      ~12     !3, 't'
         10        ADD_ARRAY_ELEMENT                                ~11     ~12, 't'
   18    11        ASSIGN_DIM                                               !2, ~8
   21    12        OP_DATA                                                  ~11
   17    13      > JMP                                                      ->4
         14    >   FE_FREE                                                  $7
   24    15      > FE_RESET_R                                       $13     !1, ->35
         16    > > FE_FETCH_R                                               $13, !3, ->35
   25    17    >   FETCH_DIM_R                                      ~14     !3, 't'
         18        ISSET_ISEMPTY_DIM_OBJ                         0          !2, ~14
         19      > JMPZ                                                     ~15, ->26
   26    20    >   FETCH_DIM_R                                      ~16     !3, 't'
         21        FETCH_DIM_R                                      ~19     !3, 'v'
         22        FETCH_DIM_W                                      $17     !2, ~16
         23        ASSIGN_DIM                                               $17, 'v2'
         24        OP_DATA                                                  ~19
   25    25      > JMP                                                      ->34
   28    26    >   FETCH_DIM_R                                      ~20     !3, 't'
   29    27        INIT_ARRAY                                       ~22     null, 'v1'
   30    28        FETCH_DIM_R                                      ~23     !3, 'v'
         29        ADD_ARRAY_ELEMENT                                ~22     ~23, 'v2'
   31    30        FETCH_DIM_R                                      ~24     !3, 't'
         31        ADD_ARRAY_ELEMENT                                ~22     ~24, 't'
   28    32        ASSIGN_DIM                                               !2, ~20
   31    33        OP_DATA                                                  ~22
   24    34    > > JMP                                                      ->16
         35    >   FE_FREE                                                  $13
   35    36        INIT_FCALL                                               'ksort'
         37        SEND_REF                                                 !2
         38        DO_ICALL                                                 
   36    39        INIT_FCALL                                               'var_export'
         40        INIT_FCALL                                               'array_values'
         41        SEND_VAR                                                 !2
         42        DO_ICALL                                         $26     
         43        SEND_VAR                                                 $26
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.05 ms | 1007 KiB | 16 Q