3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ [2015 => '2015'], [2016 => '2016'], [2017 => '2017'], [2018 => '2018'], [2019 => '2019'], [2020 => '2020'], [2021 => '2021'], [2022 => '2022'], [2023 => '2023'] ]; $result = []; array_walk($years, function($row) use(&$result) { $k = key($row); $result[$k] = $row[$k]; }); var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M81aW
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $result, !2 = $years
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   15     1        ASSIGN                                                       !1, <array>
   16     2        INIT_FCALL                                                   'array_walk'
          3        SEND_REF                                                     !2
          4        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          5        BIND_LEXICAL                                                 ~5, !1
          6        SEND_VAL                                                     ~5
          7        DO_ICALL                                                     
   17     8        INIT_FCALL                                                   'var_export'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                                     
         11      > 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/M81aW
function name:  {closure:/in/M81aW:16}
number of ops:  10
compiled vars:  !0 = $row, !1 = $result, !2 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        INIT_FCALL                                                   'key'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $3      
          5        ASSIGN                                                       !2, $3
          6        FETCH_DIM_R                                          ~6      !0, !2
          7        ASSIGN_DIM                                                   !1, !2
          8        OP_DATA                                                      ~6
          9      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.08 ms | 1748 KiB | 16 Q