3v4l.org

run code in 300+ 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                                  '%00%7Bclosure%7D%2Fin%2FM93iZ%3A17%240'
   20     4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
   17     6        ASSIGN                                                   !1, $4
   22     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FM93iZ%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M93iZ
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FM93iZ%3A17%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.09 ms | 1395 KiB | 21 Q