3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ '4X2' => 86, '4X3' => 9, '4X4' => 5, '6X2' => 14, '6X4' => 1 ]; var_export( array_reduce( array_keys($arr), fn($result, $k) => $result + [ $k => [ 'title' => $k, 'search' => "&vconfiguration[]=$k", 'count' => $arr[$k] ] ], [] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SdpX6
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'var_export'
   12     2        INIT_FCALL                                               'array_reduce'
   13     3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
   14     7        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          8        BIND_LEXICAL                                             ~3, !0
   21     9        SEND_VAL                                                 ~3
   22    10        SEND_VAL                                                 <array>
   12    11        DO_ICALL                                         $4      
   22    12        SEND_VAR                                                 $4
   11    13        DO_ICALL                                                 
   24    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/SdpX6
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $result, !1 = $k, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   17     3        INIT_ARRAY                                       ~3      !1, 'title'
   18     4        NOP                                                      
          5        FAST_CONCAT                                      ~4      '%26vconfiguration%5B%5D%3D', !1
          6        ADD_ARRAY_ELEMENT                                ~3      ~4, 'search'
   19     7        FETCH_DIM_R                                      ~5      !2, !1
          8        ADD_ARRAY_ELEMENT                                ~3      ~5, 'count'
          9        INIT_ARRAY                                       ~6      ~3, !1
         10        ADD                                              ~7      !0, ~6
         11      > RETURN                                                   ~7
   21    12*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.9 ms | 1440 KiB | 16 Q