3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '2015-09-23' => [ 'user' => [13, 12], 'count' => [ 'count' => 2, 'total' => 2, ], ], '2015-09-24' => [ 'user' => [14], 'count' => [ 'count' => 1, 'total' => 1, ], ], '2015-09-25' => [ 'user' => [15], 'count' => [ 'count' => 1, 'total' => 1, ], ], '2015-09-26' => [ 'user' => [16], 'count' => [ 'count' => 1, 'total' => 1, ], ], '2015-09-27' => [ 'user' => [17, 18], 'count' => [ 'count' => 2, 'total' => 2, ], ], '2015-09-28' => [ 'user' => [19, 20, 21, 22, 23, 24, 25, 26, 27, 28], 'count' => [ 'count' => 10, 'total' => 10, ], ], ]; var_export( array_map( function ($set) { static $prev = 0; $set['count']['total'] += $prev; $prev = $set['count']['total']; return $set; }, $array ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o6Yni
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   48     1        INIT_FCALL                                               'var_export'
   49     2        INIT_FCALL                                               'array_map'
   50     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   55     4        SEND_VAL                                                 ~2
   56     5        SEND_VAR                                                 !0
   49     6        DO_ICALL                                         $3      
   56     7        SEND_VAR                                                 $3
   48     8        DO_ICALL                                                 
   58     9      > 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/o6Yni
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $set, !1 = $prev
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   RECV                                             !0      
   51     1        BIND_STATIC                                              !1
   52     2        FETCH_DIM_RW                                     $2      !0, 'count'
          3        ASSIGN_DIM_OP                +=               1          $2, 'total'
          4        OP_DATA                                                  !1
   53     5        FETCH_DIM_R                                      ~4      !0, 'count'
          6        FETCH_DIM_R                                      ~5      ~4, 'total'
          7        ASSIGN                                                   !1, ~5
   54     8      > RETURN                                                   !0
   55     9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
205.42 ms | 1011 KiB | 15 Q