3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.42 ms | 1386 KiB | 13 Q