3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ 100 => [ ['product_id' => 101, 'name' => ''], ['product_id' => 102, 'name' => ''], ['product_id' => 103, 'name' => ''], ], 200 => [ ['product_id' => 201, 'name' => ''], ['product_id' => 202, 'name' => ''], ], 300 => [ ['product_id' => 301, 'name' => ''], ['product_id' => 302, 'name' => ''], ['product_id' => 303, 'name' => ''], ['product_id' => 304, 'name' => ''], ] ]; var_export( array_merge( #flatten the unpacked elements ...array_map( #unpack fn(...$v) => array_filter($v), #transpose discarding nulls ...$rows #transpose discarding nulls ) #unpack ) #flatten the unpacked elements );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J7Ggv
function name:  (null)
number of ops:  15
compiled vars:  !0 = $rows
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'var_export'
   22     2        INIT_FCALL                                               'array_merge'
   23     3        INIT_FCALL                                               'array_map'
   24     4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          5        SEND_VAL                                                 ~2
   25     6        SEND_UNPACK                                              !0
          7        CHECK_UNDEF_ARGS                                         
   23     8        DO_ICALL                                         $3      
   25     9        SEND_UNPACK                                              $3
         10        CHECK_UNDEF_ARGS                                         
   22    11        DO_ICALL                                         $4      
   25    12        SEND_VAR                                                 $4
   21    13        DO_ICALL                                                 
   28    14      > 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/J7Ggv
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV_VARIADIC                                    !0      
          1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.44 ms | 1002 KiB | 17 Q