3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculate($n) { $result = 0; for ($i = 1; $i <= $n; $i++) { for($j = 0; $j <= $i + 1; $j++) { $result += 1; } } return $result; } var_dump(calculate(3));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R9UJ4
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'calculate'
          2        SEND_VAL                                                 3
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function calculate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
Branch analysis from position: 4
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/R9UJ4
function name:  calculate
number of ops:  16
compiled vars:  !0 = $n, !1 = $result, !2 = $i, !3 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 0
    6     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->12
    7     4    >   ASSIGN                                                   !3, 0
          5      > JMP                                                      ->8
    8     6    >   ASSIGN_OP                                     1          !1, 1
    7     7        PRE_INC                                                  !3
          8    >   ADD                                              ~9      !2, 1
          9        IS_SMALLER_OR_EQUAL                                      !3, ~9
         10      > JMPNZ                                                    ~10, ->6
    6    11    >   PRE_INC                                                  !2
         12    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         13      > JMPNZ                                                    ~12, ->4
   11    14    > > RETURN                                                   !1
   12    15*     > RETURN                                                   null

End of function calculate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.39 ms | 944 KiB | 17 Q