3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ [ 'date' => '12-Jun-18', 'close' => 55.6, ], [ 'date' => '13-Jun-18', 'close' => 58.6, ], ]; $array2 = [ [ 'date' => '12-Jun-18', 'close' => 1.26, ], [ 'date' => '13-Jun-18', 'close' => 2.37, ], ]; $all = array_merge($array1, $array2); foreach ($all as $datapoint) { $result[$datapoint['date']] []= $datapoint['close']; } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) 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/jRQo0
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array1, !1 = $array2, !2 = $all, !3 = $datapoint, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   25     2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   27     7      > FE_RESET_R                                       $9      !2, ->15
          8    > > FE_FETCH_R                                               $9, !3, ->15
   28     9    >   FETCH_DIM_R                                      ~10     !3, 'date'
         10        FETCH_DIM_R                                      ~13     !3, 'close'
         11        FETCH_DIM_W                                      $11     !4, ~10
         12        ASSIGN_DIM                                               $11
         13        OP_DATA                                                  ~13
   27    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $9
   31    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
279.02 ms | 1011 KiB | 15 Q