3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = [ [ ["id" => 1], ["id" => 3], ["id" => 8] ], [ ["id" => 1] ], [ ["id" => 3], ["id" => 2] ] ]; $unique_ids = array_column(array_merge(...$values), "id", "id"); sort($unique_ids); var_export($unique_ids); echo "\n\n"; foreach ($values as $groups) { foreach ($groups as $rows) { $result[$rows["id"]] = $rows["id"]; } } sort($result); var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 29
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 27
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 27
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/BWT1R
function name:  (null)
number of ops:  37
compiled vars:  !0 = $values, !1 = $unique_ids, !2 = $groups, !3 = $rows, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'array_column'
          2        INIT_FCALL                                               'array_merge'
          3        SEND_UNPACK                                              !0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_ICALL                                         $6      
          6        SEND_VAR                                                 $6
          7        SEND_VAL                                                 'id'
          8        SEND_VAL                                                 'id'
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
   19    11        INIT_FCALL                                               'sort'
         12        SEND_REF                                                 !1
         13        DO_ICALL                                                 
   20    14        INIT_FCALL                                               'var_export'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   21    17        ECHO                                                     '%0A%0A'
   23    18      > FE_RESET_R                                       $11     !0, ->29
         19    > > FE_FETCH_R                                               $11, !2, ->29
   24    20    > > FE_RESET_R                                       $12     !2, ->27
         21    > > FE_FETCH_R                                               $12, !3, ->27
   25    22    >   FETCH_DIM_R                                      ~13     !3, 'id'
         23        FETCH_DIM_R                                      ~15     !3, 'id'
         24        ASSIGN_DIM                                               !4, ~13
         25        OP_DATA                                                  ~15
   24    26      > JMP                                                      ->21
         27    >   FE_FREE                                                  $12
   23    28      > JMP                                                      ->19
         29    >   FE_FREE                                                  $11
   28    30        INIT_FCALL                                               'sort'
         31        SEND_REF                                                 !4
         32        DO_ICALL                                                 
   29    33        INIT_FCALL                                               'var_export'
         34        SEND_VAR                                                 !4
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.2 ms | 1018 KiB | 17 Q