3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculate($n) { $result = 0; for ($i = 1; $i <= $n; $i++) { for($j = 1; $j <= $i; $j++) { $result += 1; } } return $result; } var_dump(calculate(30));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ch8d2
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                                                 30
          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 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
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 = 10, Position 2 = 6
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 6
Branch analysis from position: 10
Branch analysis from position: 6
filename:       /in/ch8d2
function name:  calculate
number of ops:  15
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                                                      ->11
    7     4    >   ASSIGN                                                   !3, 1
          5      > JMP                                                      ->8
    8     6    >   ASSIGN_OP                                     1          !1, 1
    7     7        PRE_INC                                                  !3
          8    >   IS_SMALLER_OR_EQUAL                                      !3, !2
          9      > JMPNZ                                                    ~9, ->6
    6    10    >   PRE_INC                                                  !2
         11    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         12      > JMPNZ                                                    ~11, ->4
   11    13    > > RETURN                                                   !1
   12    14*     > RETURN                                                   null

End of function calculate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.85 ms | 1399 KiB | 16 Q