3v4l.org

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

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.03 ms | 1008 KiB | 17 Q