3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["one" => 1, "two-two" => 2, "four" => 4], ["two-two" => 22, "three" => 33, "four" => 44] ]; var_export( array_reduce( array_keys(array_merge(...$array)), function($result, $key) { $result[$key] = ucwords(str_replace(['_', '-'], ' ', $key)); return $result; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lMWnU
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'var_export'
    9     2        INIT_FCALL                                               'array_reduce'
   10     3        INIT_FCALL                                               'array_keys'
          4        INIT_FCALL                                               'array_merge'
          5        SEND_UNPACK                                              !0
          6        CHECK_UNDEF_ARGS                                         
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
   11    11        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
   14    12        SEND_VAL                                                 ~4
    9    13        DO_ICALL                                         $5      
   14    14        SEND_VAR                                                 $5
    8    15        DO_ICALL                                                 
   16    16      > 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/lMWnU
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $result, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_FCALL                                               'ucwords'
          3        INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 <array>
          5        SEND_VAL                                                 '+'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                         $4      
         10        ASSIGN_DIM                                               !0, !1
         11        OP_DATA                                                  $4
   13    12      > RETURN                                                   !0
   14    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.19 ms | 1017 KiB | 19 Q