3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ "code" => "BTC", "name" => "Bitcoin", "rate" => 1 ], [ "code" => "BCH", "name" => "Bitcoin Cash", "rate" => 7.06364 ], [ "code" => "USD", "name" => "US Dollar", "rate" => 8185.84 ], ]; $array = array_reduce($array, function($carry, $item) { $carry[$item["code"]] = $item; return $carry; }); echo $array["USD"]["rate"];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Al03k
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   22     1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   25     4        SEND_VAL                                                 ~2
   22     5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
   27     7        FETCH_DIM_R                                      ~5      !0, 'USD'
          8        FETCH_DIM_R                                      ~6      ~5, 'rate'
          9        ECHO                                                     ~6
         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/Al03k
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $carry, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        FETCH_DIM_R                                      ~2      !1, 'code'
          3        ASSIGN_DIM                                               !0, ~2
          4        OP_DATA                                                  !1
   24     5      > RETURN                                                   !0
   25     6*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.19 ms | 1010 KiB | 14 Q