3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arrData = array ( array( 'a' => 'test', 'c' => 1, 'd' => 2, 'e' => 'B' ), array( 'c' => 1, 'd' => 2, 'e' => 'B' ), array( 'b' => 'test2', 'c' => 1, 'd' => 2, 'e' => 'B' ) ); $out = array(); foreach ($arrData as $arr) { $out = array_merge($out, $arr); } print_r($out); $out = array_reduce($arrData, function ($c, $v) { return array_merge($c, $v); }, array()); ksort($out); print_r($out);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/OJYJQ
function name:  (null)
number of ops:  28
compiled vars:  !0 = $arrData, !1 = $out, !2 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   23     1        ASSIGN                                                       !1, <array>
   24     2      > FE_RESET_R                                           $5      !0, ->10
          3    > > FE_FETCH_R                                                   $5, !2, ->10
   25     4    >   INIT_FCALL                                                   'array_merge'
          5        SEND_VAR                                                     !1
          6        SEND_VAR                                                     !2
          7        DO_ICALL                                             $6      
          8        ASSIGN                                                       !1, $6
   24     9      > JMP                                                          ->3
         10    >   FE_FREE                                                      $5
   27    11        INIT_FCALL                                                   'print_r'
         12        SEND_VAR                                                     !1
         13        DO_ICALL                                                     
   29    14        INIT_FCALL                                                   'array_reduce'
         15        SEND_VAR                                                     !0
         16        DECLARE_LAMBDA_FUNCTION                              ~9      [0]
         17        SEND_VAL                                                     ~9
         18        SEND_VAL                                                     <array>
         19        DO_ICALL                                             $10     
         20        ASSIGN                                                       !1, $10
   30    21        INIT_FCALL                                                   'ksort'
         22        SEND_REF                                                     !1
         23        DO_ICALL                                                     
   31    24        INIT_FCALL                                                   'print_r'
         25        SEND_VAR                                                     !1
         26        DO_ICALL                                                     
         27      > 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/OJYJQ
function name:  {closure:/in/OJYJQ:29}
number of ops:  8
compiled vars:  !0 = $c, !1 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   29     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        INIT_FCALL                                                   'array_merge'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        DO_ICALL                                             $2      
          6      > RETURN                                                       $2
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.24 ms | 2140 KiB | 17 Q