3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Array ( [0] => Array ( [amount] => 1439.53 [c_year] => 2021 [c_month] => 9 [short_month] => Sep ) [1] => Array ( [amount] => 1448.13 [c_year] => 2021 [c_month] => 10 [short_month] => Oct ) ) $resultsArray = [ [ "amount" => 1439.53, "c_year" => 2021, "c_month" => 9, "short_month" => "Sep" ], [ "amount" => 1448.13, "c_year" => 2021, "c_month" => 10, "short_month" => "Oct" ] ]; $monthsFees = array_map(function($fee) { return [ "month" => sprintf("%s-%s", $fee["c_month"], $fee["c_year"]), "amount" => $fee["amount"] ]; }, $resultsArray); print_r($monthsFees);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0trIY
function name:  (null)
number of ops:  11
compiled vars:  !0 = $resultsArray, !1 = $monthsFees
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, <array>
   20     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   25     3        SEND_VAL                                                     ~3
          4        SEND_VAR                                                     !0
   20     5        DO_ICALL                                             $4      
          6        ASSIGN                                                       !1, $4
   27     7        INIT_FCALL                                                   'print_r'
          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/0trIY
function name:  {closure:/in/0trIY:20}
number of ops:  11
compiled vars:  !0 = $fee
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
   22     1        FETCH_DIM_R                                          ~1      !0, 'c_month'
          2        FETCH_DIM_R                                          ~2      !0, 'c_year'
          3        ROPE_INIT                                         3  ~4      ~1
          4        ROPE_ADD                                          1  ~4      ~4, '-'
          5        ROPE_END                                          2  ~3      ~4, ~2
          6        INIT_ARRAY                                           ~6      ~3, 'month'
   23     7        FETCH_DIM_R                                          ~7      !0, 'amount'
          8        ADD_ARRAY_ELEMENT                                    ~6      ~7, 'amount'
          9      > RETURN                                                       ~6
   25    10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.72 ms | 2012 KiB | 15 Q