3v4l.org

run code in 500+ PHP versions simultaneously
<?php $oldArr = [ [ "t1" => "test1" ],[ "t2" => "test2" ],[ "t3" => "test3" ],[ "t4" => "test4" ],[ "t5" => "test5" ] ]; $newArr = array_reduce($oldArr, function($carry, $item){ $carry[key($item)] = reset($item); return $carry; }); var_dump($newArr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M93iZ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $oldArr, !1 = $newArr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   17     1        INIT_FCALL                                                   'array_reduce'
          2        SEND_VAR                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   20     4        SEND_VAL                                                     ~3
   17     5        DO_ICALL                                             $4      
          6        ASSIGN                                                       !1, $4
   22     7        INIT_FCALL                                                   'var_dump'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                                     
         10      > 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/M93iZ
function name:  {closure:/in/M93iZ:17}
number of ops:  12
compiled vars:  !0 = $carry, !1 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   18     2        INIT_FCALL                                                   'key'
          3        SEND_VAR                                                     !1
          4        DO_ICALL                                             $2      
          5        INIT_FCALL                                                   'reset'
          6        SEND_REF                                                     !1
          7        DO_ICALL                                             $4      
          8        ASSIGN_DIM                                                   !0, $2
          9        OP_DATA                                                      $4
   19    10      > RETURN                                                       !0
   20    11*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.77 ms | 2635 KiB | 17 Q