3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ [['value' => 1100], ['value' => 1000], ['value' => 3000]], [['value' => 1200], ['value' => 2000], ['value' => 2000]], [['value' => 1300], ['value' => 4000], ['value' => 1000]], ]; var_export( array_map(fn(...$col) => $col, ...$array) // to demonstrate transposition ); echo "\n---\n"; var_export( array_map( fn(...$col) => array_sum(array_column($col, 'value')), ...$array ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0eqvj
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        INIT_FCALL                                                   'var_export'
   10     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          4        SEND_VAL                                                     ~2
          5        SEND_UNPACK                                                  !0
          6        CHECK_UNDEF_ARGS                                             
          7        DO_ICALL                                             $3      
          8        SEND_VAR                                                     $3
    9     9        DO_ICALL                                                     
   13    10        ECHO                                                         '%0A---%0A'
   15    11        INIT_FCALL                                                   'var_export'
   16    12        INIT_FCALL                                                   'array_map'
   17    13        DECLARE_LAMBDA_FUNCTION                              ~5      [1]
         14        SEND_VAL                                                     ~5
   18    15        SEND_UNPACK                                                  !0
         16        CHECK_UNDEF_ARGS                                             
   16    17        DO_ICALL                                             $6      
   18    18        SEND_VAR                                                     $6
   15    19        DO_ICALL                                                     
   20    20      > 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/0eqvj
function name:  {closure:/in/0eqvj:10}
number of ops:  3
compiled vars:  !0 = $col
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV_VARIADIC                                        !0      
          1      > RETURN                                                       !0
          2*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0eqvj
function name:  {closure:/in/0eqvj:17}
number of ops:  10
compiled vars:  !0 = $col
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV_VARIADIC                                        !0      
          1        INIT_FCALL                                                   'array_sum'
          2        INIT_FCALL                                                   'array_column'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     'value'
          5        DO_ICALL                                             $1      
          6        SEND_VAR                                                     $1
          7        DO_ICALL                                             $2      
          8      > RETURN                                                       $2
          9*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
191.04 ms | 1975 KiB | 16 Q