3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = [1, 2, 3, 4, 5]; function x(array $numbers) { $result = array(); $previous_value = 0; foreach($numbers as $number) { $result[] = $previous_value + $number; $previous_value = $number; } return $result; } var_dump(x($numbers));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vga9k
function name:  (null)
number of ops:  8
compiled vars:  !0 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'x'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/Vga9k
function name:  x
number of ops:  13
compiled vars:  !0 = $numbers, !1 = $result, !2 = $previous_value, !3 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, <array>
    8     2        ASSIGN                                                   !2, 0
   10     3      > FE_RESET_R                                       $6      !0, ->10
          4    > > FE_FETCH_R                                               $6, !3, ->10
   11     5    >   ADD                                              ~8      !2, !3
          6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  ~8
   12     8        ASSIGN                                                   !2, !3
   10     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $6
   15    11      > RETURN                                                   !1
   16    12*     > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.12 ms | 1398 KiB | 16 Q