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)), fn($result, $key) => array_merge( $result, [$key => ucwords(str_replace(['_', '-'], ' ', $key))] ), [] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3b5f
function name:  (null)
number of ops:  18
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]
   15    12        SEND_VAL                                                 ~4
   16    13        SEND_VAL                                                 <array>
    9    14        DO_ICALL                                         $5      
   16    15        SEND_VAR                                                 $5
    8    16        DO_ICALL                                                 
   18    17      > 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/d3b5f
function name:  {closure}
number of ops:  17
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                                               'array_merge'
   13     3        SEND_VAR                                                 !0
   14     4        INIT_FCALL                                               'ucwords'
          5        INIT_FCALL                                               'str_replace'
          6        SEND_VAL                                                 <array>
          7        SEND_VAL                                                 '+'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                         $3      
         12        INIT_ARRAY                                       ~4      $3, !1
         13        SEND_VAL                                                 ~4
   12    14        DO_ICALL                                         $5      
   14    15      > RETURN                                                   $5
   15    16*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.86 ms | 1017 KiB | 19 Q