3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ ['item' => '39.00', 'time' => '0.00'], ['item' => '49.00'], ['time' => '0.00', 'Value' => 0], ['item' => '49.00', 'time' => '0.00'] ]; $array2 = [ ['item' => '39.00', 'time' => '10.00'], ['item' => '49.00'], ['time' => '0.00', 'Value' => 0], ['item' => '49.00', 'time' => '0.00', 'Value' => 3] ]; $result = []; foreach ($array1 as $i => $row1) { $diff = array_diff_assoc($array2[$i], $row1) + array_diff_assoc($row1, $array2[$i]); if ($diff) { $result[$i] = $diff; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 22
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/0s8Tb
function name:  (null)
number of ops:  27
compiled vars:  !0 = $array1, !1 = $array2, !2 = $result, !3 = $row1, !4 = $i, !5 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   17     2        ASSIGN                                                   !2, <array>
   18     3      > FE_RESET_R                                       $9      !0, ->22
          4    > > FE_FETCH_R                                       ~10     $9, !3, ->22
          5    >   ASSIGN                                                   !4, ~10
   19     6        INIT_FCALL                                               'array_diff_assoc'
          7        FETCH_DIM_R                                      ~12     !1, !4
          8        SEND_VAL                                                 ~12
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $13     
         11        INIT_FCALL                                               'array_diff_assoc'
         12        SEND_VAR                                                 !3
         13        FETCH_DIM_R                                      ~14     !1, !4
         14        SEND_VAL                                                 ~14
         15        DO_ICALL                                         $15     
         16        ADD                                              ~16     $13, $15
         17        ASSIGN                                                   !5, ~16
   20    18      > JMPZ                                                     !5, ->21
   21    19    >   ASSIGN_DIM                                               !2, !4
         20        OP_DATA                                                  !5
   18    21    > > JMP                                                      ->4
         22    >   FE_FREE                                                  $9
   24    23        INIT_FCALL                                               'var_export'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.83 ms | 1012 KiB | 15 Q