3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); ini_set('display_errors', 1); const GIVEN = 3; $sum = 1; for ($k = 1; $k <= 20; $k++) { $sum += pow(GIVEN, $k); } echo $sum; echo PHP_EOL . PHP_EOL . '=====' . PHP_EOL . PHP_EOL; $s = 0; $p = 1; for ($i = 1; $i <= 20; $i++) { echo $i . ' ' . $p . PHP_EOL; for ($k = 1; $k <= $i; $k++) { $p = $p * 3; } $s = $s+$p; } echo $s;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 11
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 26
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 32
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 26
Branch analysis from position: 42
Branch analysis from position: 26
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 32
Branch analysis from position: 37
Branch analysis from position: 32
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 11
Branch analysis from position: 20
Branch analysis from position: 11
filename:       /in/ote7K
function name:  (null)
number of ops:  44
compiled vars:  !0 = $sum, !1 = $k, !2 = $s, !3 = $p, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'display_errors'
          5        SEND_VAL                                                 1
          6        DO_ICALL                                                 
    6     7        DECLARE_CONST                                            'GIVEN', 3
    8     8        ASSIGN                                                   !0, 1
   10     9        ASSIGN                                                   !1, 1
         10      > JMP                                                      ->18
   11    11    >   INIT_FCALL                                               'pow'
         12        FETCH_CONSTANT                                   ~9      'GIVEN'
         13        SEND_VAL                                                 ~9
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $10     
         16        ASSIGN_OP                                     1          !0, $10
   10    17        PRE_INC                                                  !1
         18    >   IS_SMALLER_OR_EQUAL                                      !1, 20
         19      > JMPNZ                                                    ~13, ->11
   14    20    >   ECHO                                                     !0
   15    21        ECHO                                                     '%0A%0A%3D%3D%3D%3D%3D%0A%0A'
   17    22        ASSIGN                                                   !2, 0
   18    23        ASSIGN                                                   !3, 1
   20    24        ASSIGN                                                   !4, 1
         25      > JMP                                                      ->40
   21    26    >   CONCAT                                           ~17     !4, '+'
         27        CONCAT                                           ~18     ~17, !3
         28        CONCAT                                           ~19     ~18, '%0A'
         29        ECHO                                                     ~19
   22    30        ASSIGN                                                   !1, 1
         31      > JMP                                                      ->35
   23    32    >   MUL                                              ~21     !3, 3
         33        ASSIGN                                                   !3, ~21
   22    34        PRE_INC                                                  !1
         35    >   IS_SMALLER_OR_EQUAL                                      !1, !4
         36      > JMPNZ                                                    ~24, ->32
   25    37    >   ADD                                              ~25     !2, !3
         38        ASSIGN                                                   !2, ~25
   20    39        PRE_INC                                                  !4
         40    >   IS_SMALLER_OR_EQUAL                                      !4, 20
         41      > JMPNZ                                                    ~28, ->26
   28    42    >   ECHO                                                     !2
   29    43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.94 ms | 1005 KiB | 16 Q