3v4l.org

run code in 300+ PHP versions simultaneously
<?php $set = ['a','b','c']; $max = 5; // start at non-zero echo 'Plus' . PHP_EOL; $cur = 0; $i = 3; while($i--){ echo $i . PHP_EOL; $cur++; if ($cur > $max) { break; } } // starting at zero echo '@0' . PHP_EOL; $cur = 0; $i = 0; while($i--){ echo $i . PHP_EOL; $cur++; if ($cur > $max) { break; } } echo 'Done' . PHP_EOL;
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 = 6
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 18
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 24
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 12
filename:       /in/7HtqG
function name:  (null)
number of ops:  28
compiled vars:  !0 = $set, !1 = $max, !2 = $cur, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 5
    8     2        ECHO                                                     'Plus%0A'
    9     3        ASSIGN                                                   !2, 0
   10     4        ASSIGN                                                   !3, 3
   11     5      > JMP                                                      ->12
   12     6    >   CONCAT                                           ~8      !3, '%0A'
          7        ECHO                                                     ~8
   13     8        PRE_INC                                                  !2
   14     9        IS_SMALLER                                               !1, !2
         10      > JMPZ                                                     ~10, ->12
         11    > > JMP                                                      ->14
   11    12    >   POST_DEC                                         ~11     !3
         13      > JMPNZ                                                    ~11, ->6
   18    14    >   ECHO                                                     '%400%0A'
   19    15        ASSIGN                                                   !2, 0
   20    16        ASSIGN                                                   !3, 0
   21    17      > JMP                                                      ->24
   22    18    >   CONCAT                                           ~14     !3, '%0A'
         19        ECHO                                                     ~14
   23    20        PRE_INC                                                  !2
   24    21        IS_SMALLER                                               !1, !2
         22      > JMPZ                                                     ~16, ->24
         23    > > JMP                                                      ->26
   21    24    >   POST_DEC                                         ~17     !3
         25      > JMPNZ                                                    ~17, ->18
   27    26    >   ECHO                                                     'Done%0A'
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.82 ms | 1395 KiB | 13 Q