3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'mc_gross' => 10.17, 'protection_eligibility' => 'Eligible', 'address_status' => 'unconfirmed', 'payer_id' => 'STTAC7UV2CVJ4' ]; var_export( array_reduce( array_keys($array), fn($result, $k) => $result + [str_replace('_', '', ucwords($k, '_')) => $array[$k]], [] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQF9C
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'var_export'
   11     2        INIT_FCALL                                               'array_reduce'
   12     3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
   13     7        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          8        BIND_LEXICAL                                             ~3, !0
          9        SEND_VAL                                                 ~3
   14    10        SEND_VAL                                                 <array>
   11    11        DO_ICALL                                         $4      
   14    12        SEND_VAR                                                 $4
   10    13        DO_ICALL                                                 
   16    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/UQF9C
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $result, !1 = $k, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 '_'
          5        SEND_VAL                                                 ''
          6        INIT_FCALL                                               'ucwords'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 '_'
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                         $4      
         12        FETCH_DIM_R                                      ~5      !2, !1
         13        INIT_ARRAY                                       ~6      ~5, $4
         14        ADD                                              ~7      !0, ~6
         15      > RETURN                                                   ~7
         16*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.77 ms | 1003 KiB | 18 Q