3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = []; $n = count(100); $sum = 0; for ($i = 0; $i < $n; $i++) { $elem = $arr[$i]; if ($elem > 0) { $sum = $sum + $elem; } } return $sum;
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 = 15, Position 2 = 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 6
Branch analysis from position: 15
Branch analysis from position: 6
Branch analysis from position: 12
filename:       /in/sNQFF
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr, !1 = $n, !2 = $sum, !3 = $i, !4 = $elem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        COUNT                                            ~6      100
          2        ASSIGN                                                   !1, ~6
    5     3        ASSIGN                                                   !2, 0
    6     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->13
    7     6    >   FETCH_DIM_R                                      ~10     !0, !3
          7        ASSIGN                                                   !4, ~10
    8     8        IS_SMALLER                                               0, !4
          9      > JMPZ                                                     ~12, ->12
    9    10    >   ADD                                              ~13     !2, !4
         11        ASSIGN                                                   !2, ~13
    6    12    >   PRE_INC                                                  !3
         13    >   IS_SMALLER                                               !3, !1
         14      > JMPNZ                                                    ~16, ->6
   12    15    > > RETURN                                                   !2
         16*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.87 ms | 1398 KiB | 13 Q