3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = ['A[1]', 'B[2]', 'C[2]', 'D[2]']; $b = ['B[3]', 'C[4]', 'E[4]', 'F[2]', 'G[2]']; var_export( array_values( array_reduce( array_merge($a, $b), function($result, $v) { $result[strtok($v, '[')] = $v; return $result; } ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4mO2j
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    6     2        INIT_FCALL                                                   'var_export'
    7     3        INIT_FCALL                                                   'array_values'
    8     4        INIT_FCALL                                                   'array_reduce'
    9     5        INIT_FCALL                                                   'array_merge'
          6        SEND_VAR                                                     !0
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                             $4      
          9        SEND_VAR                                                     $4
   10    10        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
   13    11        SEND_VAL                                                     ~5
    8    12        DO_ICALL                                             $6      
   13    13        SEND_VAR                                                     $6
    7    14        DO_ICALL                                             $7      
   13    15        SEND_VAR                                                     $7
    6    16        DO_ICALL                                                     
   16    17      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4mO2j
function name:  {closure:/in/4mO2j:10}
number of ops:  10
compiled vars:  !0 = $result, !1 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   11     2        INIT_FCALL                                                   'strtok'
          3        SEND_VAR                                                     !1
          4        SEND_VAL                                                     '%5B'
          5        DO_ICALL                                             $2      
          6        ASSIGN_DIM                                                   !0, $2
          7        OP_DATA                                                      !1
   12     8      > RETURN                                                       !0
   13     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.48 ms | 1879 KiB | 18 Q