3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['read' => [1,2]]; $b = ['read' => [2,3]]; $c = array_replace($b, $a); foreach ($c as $key => $value) { if (is_array($value) && isset($b[$key])) { $c[$key] = array_unique(array_replace($value, $b[$key])); } elseif (empty($value) && isset($b[$key])) { $c[$key] = $b[$key]; } } var_dump($c);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 35
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 35
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 26
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 34
Branch analysis from position: 30
Branch analysis from position: 14
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/kQPtV
function name:  (null)
number of ops:  40
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'array_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    9     7      > FE_RESET_R                                       $9      !2, ->35
          8    > > FE_FETCH_R                                       ~10     $9, !3, ->35
          9    >   ASSIGN                                                   !4, ~10
   10    10        TYPE_CHECK                                  128  ~12     !3
         11      > JMPZ_EX                                          ~12     ~12, ->14
         12    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !1, !4
         13        BOOL                                             ~12     ~13
         14    > > JMPZ                                                     ~12, ->26
   11    15    >   INIT_FCALL                                               'array_unique'
         16        INIT_FCALL                                               'array_replace'
         17        SEND_VAR                                                 !3
         18        FETCH_DIM_R                                      ~15     !1, !4
         19        SEND_VAL                                                 ~15
         20        DO_ICALL                                         $16     
         21        SEND_VAR                                                 $16
         22        DO_ICALL                                         $17     
         23        ASSIGN_DIM                                               !2, !4
         24        OP_DATA                                                  $17
         25      > JMP                                                      ->34
   12    26    >   ISSET_ISEMPTY_CV                                 ~18     !3
         27      > JMPZ_EX                                          ~18     ~18, ->30
         28    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~19     !1, !4
         29        BOOL                                             ~18     ~19
         30    > > JMPZ                                                     ~18, ->34
   13    31    >   FETCH_DIM_R                                      ~21     !1, !4
         32        ASSIGN_DIM                                               !2, !4
         33        OP_DATA                                                  ~21
    9    34    > > JMP                                                      ->8
         35    >   FE_FREE                                                  $9
   17    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.27 ms | 1405 KiB | 19 Q