3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ (object) ["email" => "gffggfg"], (object) ["email" => "wefwef@test.it"], (object) ["email" => "wefewf"], ]; $array2 = [ (object) ["email" => "gffggfg@test.it"], (object) ["email" => "wefwef"], (object) ["email" => "wefewf"], ]; function concatArrays($arrays){ $buf = []; foreach($arrays as $arr){ foreach($arr as $v){ $buf[$v] = true; } } return array_keys($buf); } var_export( concatArrays([$array1, $array2]) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dp6tt
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~2      <array>
          1        INIT_ARRAY                                       ~3      ~2
    5     2        CAST                                          8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                ~3      ~4
    6     4        CAST                                          8  ~5      <array>
          5        ADD_ARRAY_ELEMENT                                ~3      ~5
    3     6        ASSIGN                                                   !0, ~3
    9     7        CAST                                          8  ~7      <array>
          8        INIT_ARRAY                                       ~8      ~7
   10     9        CAST                                          8  ~9      <array>
         10        ADD_ARRAY_ELEMENT                                ~8      ~9
   11    11        CAST                                          8  ~10     <array>
         12        ADD_ARRAY_ELEMENT                                ~8      ~10
    8    13        ASSIGN                                                   !1, ~8
   24    14        INIT_FCALL                                               'var_export'
   25    15        INIT_FCALL                                               'concatarrays'
         16        INIT_ARRAY                                       ~12     !0
         17        ADD_ARRAY_ELEMENT                                ~12     !1
         18        SEND_VAL                                                 ~12
         19        DO_FCALL                                      0  $13     
         20        SEND_VAR                                                 $13
   24    21        DO_ICALL                                                 
   26    22      > RETURN                                                   1

Function concatarrays:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/dp6tt
function name:  concatArrays
number of ops:  17
compiled vars:  !0 = $arrays, !1 = $buf, !2 = $arr, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $5      !0, ->11
          3    > > FE_FETCH_R                                               $5, !2, ->11
   17     4    > > FE_RESET_R                                       $6      !2, ->9
          5    > > FE_FETCH_R                                               $6, !3, ->9
   18     6    >   ASSIGN_DIM                                               !1, !3
          7        OP_DATA                                                  <true>
   17     8      > JMP                                                      ->5
          9    >   FE_FREE                                                  $6
   16    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $5
   21    12        INIT_FCALL                                               'array_keys'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $8      
         15      > RETURN                                                   $8
   22    16*     > RETURN                                                   null

End of function concatarrays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.01 ms | 1008 KiB | 16 Q