3v4l.org

run code in 300+ PHP versions simultaneously
<?php // user input of years $ar = [1944, 1674, 3021]; // find max year $maxCentury = max(...$ar); // get max century $roundedCentury = round($maxCentury, -3); foreach($ar as $year) { foreach(range(0, $roundedCentury, 1000) as $century) { if($century <= $year) { echo "<li> $century <ul>" . $year . "</ul> </li>"; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 31
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 31
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 29
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 28
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 29
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/2bG7C
function name:  (null)
number of ops:  33
compiled vars:  !0 = $ar, !1 = $maxCentury, !2 = $roundedCentury, !3 = $year, !4 = $century
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'max'
          2        SEND_UNPACK                                              !0
          3        CHECK_UNDEF_ARGS                                         
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   10     6        INIT_FCALL                                               'round'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 -3
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
   12    11      > FE_RESET_R                                       $10     !0, ->31
         12    > > FE_FETCH_R                                               $10, !3, ->31
   13    13    >   INIT_FCALL                                               'range'
         14        SEND_VAL                                                 0
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 1000
         17        DO_ICALL                                         $11     
         18      > FE_RESET_R                                       $12     $11, ->29
         19    > > FE_FETCH_R                                               $12, !4, ->29
   14    20    >   IS_SMALLER_OR_EQUAL                                      !4, !3
         21      > JMPZ                                                     ~13, ->28
   15    22    >   ROPE_INIT                                     3  ~15     '%3Cli%3E+'
         23        ROPE_ADD                                      1  ~15     ~15, !4
         24        ROPE_END                                      2  ~14     ~15, '+%3Cul%3E'
         25        CONCAT                                           ~17     ~14, !3
         26        CONCAT                                           ~18     ~17, '%3C%2Ful%3E+%3C%2Fli%3E'
         27        ECHO                                                     ~18
   13    28    > > JMP                                                      ->19
         29    >   FE_FREE                                                  $12
   12    30      > JMP                                                      ->12
         31    >   FE_FREE                                                  $10
   18    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.25 ms | 1401 KiB | 19 Q