3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'a' => 'b', 'c' => 'd', 'h' => 'e', 'i' => 'm' ], [ 'a' => 'b', 'f' => 'g', 'c' => 'f' ], [ 'a' => 'd', 'c' => 'd' ], [ 'i' => 'm' ] ]; for ($i = 1, $count = count($array); $i < $count; ++$i) { $array[$i] = array_diff_assoc( $array[$i], ...array_slice($array, 0, $i, true) ); } var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 5
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 5
Branch analysis from position: 22
Branch analysis from position: 5
filename:       /in/GkqY8
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $i, !2 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   24     1        ASSIGN                                                   !1, 1
          2        COUNT                                            ~5      !0
          3        ASSIGN                                                   !2, ~5
          4      > JMP                                                      ->20
   25     5    >   INIT_FCALL                                               'array_diff_assoc'
   26     6        FETCH_DIM_R                                      ~8      !0, !1
          7        SEND_VAL                                                 ~8
   27     8        INIT_FCALL                                               'array_slice'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $9      
         14        SEND_UNPACK                                              $9
         15        CHECK_UNDEF_ARGS                                         
   25    16        DO_ICALL                                         $10     
         17        ASSIGN_DIM                                               !0, !1
   27    18        OP_DATA                                                  $10
   24    19        PRE_INC                                                  !1
         20    >   IS_SMALLER                                               !1, !2
         21      > JMPNZ                                                    ~12, ->5
   30    22    >   INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.08 ms | 1000 KiB | 16 Q