3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=array(1100,3150,4430,4430,5170,7450,7450,7450,8230); $out = array($arr[0]); for ($i = 1; $i < count($arr); $i++) { $out[$i] = $out[$i-1] + $arr[$i]; } $arr = array_combine($out, $arr); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/AnaOt
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $out, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_DIM_R                                      ~4      !0, 0
          2        INIT_ARRAY                                       ~5      ~4
          3        ASSIGN                                                   !1, ~5
    5     4        ASSIGN                                                   !2, 1
          5      > JMP                                                      ->13
    6     6    >   SUB                                              ~9      !2, 1
          7        FETCH_DIM_R                                      ~10     !1, ~9
          8        FETCH_DIM_R                                      ~11     !0, !2
          9        ADD                                              ~12     ~10, ~11
         10        ASSIGN_DIM                                               !1, !2
         11        OP_DATA                                                  ~12
    5    12        PRE_INC                                                  !2
         13    >   COUNT                                            ~14     !0
         14        IS_SMALLER                                               !2, ~14
         15      > JMPNZ                                                    ~15, ->6
    8    16    >   INIT_FCALL                                               'array_combine'
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !0, $16
    9    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.83 ms | 999 KiB | 15 Q