3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [['xxx', 3], ['yyy', 2]]; var_export( array_merge( ...array_map( fn($row) => array_fill(0, $row[1], [$row[0]]), $array ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rXpb1
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'var_export'
    6     2        INIT_FCALL                                               'array_merge'
    7     3        INIT_FCALL                                               'array_map'
    8     4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          5        SEND_VAL                                                 ~2
    9     6        SEND_VAR                                                 !0
    7     7        DO_ICALL                                         $3      
    9     8        SEND_UNPACK                                              $3
          9        CHECK_UNDEF_ARGS                                         
    6    10        DO_ICALL                                         $4      
    9    11        SEND_VAR                                                 $4
    5    12        DO_ICALL                                                 
   12    13      > 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/rXpb1
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_fill'
          2        SEND_VAL                                                 0
          3        FETCH_DIM_R                                      ~1      !0, 1
          4        SEND_VAL                                                 ~1
          5        FETCH_DIM_R                                      ~2      !0, 0
          6        INIT_ARRAY                                       ~3      ~2
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                         $4      
          9      > RETURN                                                   $4
         10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.71 ms | 1013 KiB | 17 Q