3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* http://3v4l.org/DCTnA */ /* < [1] 2 3 ... 22 23 > < 1 [2] 3 ... 22 23 > < 1 2 [3] 4 ... 22 23 > < 1 2 3 [4] 5 ... 22 23 > < 1 2 ... 4 [5] 6 ... 22 23 > < 1 2 ... 5 [6] 7 ... 22 23 > ... < 1 2 ... 18 [19] 20 ... 22 23 > < 1 2 ... 19 [20] 21 22 23 > < 1 2 ... 20 [21] 22 23 > < 1 2 ... 21 [22] 23 > < 1 2 ... 22 [23] > */ $currentpageid = $nmstart = 2; $nrtotal = 23; $nrposts = 1; $pages = ''; $ssPagingStartCount = 2; $ssPagingCurrentCount = 3; $ssPagingEndCount = 2; $totalpages = ceil($nrtotal / $nrposts); if ($totalpages > 1 ){ /* for ($x = 0; $x < $totalpages; ++$x) { $inc = $x * $nrposts; $display = $x + 1; if($inc != $nmstart) { $pages .= "\n<a class=\"nl_page\" href='" . "nmstart=$inc'>".$display."</a>"; } else { $pages .= "\n<span class=\"nl_page nl_page__currentpage\">".$display."</span>"; } } */ //$ssPagingCurrentCountRight = max($ssPagingStartCount, ($currentpageid + (int)($ssPagingCurrentCount/2))); $ssPagingCurrentCountFrom = $currentpageid - (int)($ssPagingCurrentCount/2) - 1; if ( $ssPagingCurrentCountFrom < 0 ) $ssPagingCurrentCountFrom = 0; $ssPagingCurrentCountTo = $currentpageid + (int)($ssPagingCurrentCount/2) + 1; if ( $ssPagingCurrentCountTo > $totalpages ) $ssPagingCurrentCountTo = $totalpages; if ( ($currentpageid >= 0) && ($currentpageid <= ($ssPagingStartCount + (int)($ssPagingCurrentCount/2))) ) { for ($x = 0; $x < $ssPagingCurrentCountTo; ++$x) { $inc = $x * $nrposts; $display = $x + 1; if ($inc != $nmstart) { $pages .= "\n<a class=\"nl_page\" href='" . "nmstart=$inc'>".$display."</a>"; } else { $pages .= "\n<span class=\"nl_page nl_page__currentpage\">".$display."</span>"; } } } } var_dump($pages); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 61
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 33, Position 2 = 38
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 61
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 41
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 55
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 41
Branch analysis from position: 61
Branch analysis from position: 41
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 41
Branch analysis from position: 61
Branch analysis from position: 41
Branch analysis from position: 61
Branch analysis from position: 38
Branch analysis from position: 31
Branch analysis from position: 23
Branch analysis from position: 61
filename:       /in/OrjMT
function name:  (null)
number of ops:  65
compiled vars:  !0 = $currentpageid, !1 = $nmstart, !2 = $nrtotal, !3 = $nrposts, !4 = $pages, !5 = $ssPagingStartCount, !6 = $ssPagingCurrentCount, !7 = $ssPagingEndCount, !8 = $totalpages, !9 = $ssPagingCurrentCountFrom, !10 = $ssPagingCurrentCountTo, !11 = $x, !12 = $inc, !13 = $display
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN                                           ~14     !1, 2
          1        ASSIGN                                                   !0, ~14
   22     2        ASSIGN                                                   !2, 23
   23     3        ASSIGN                                                   !3, 1
   24     4        ASSIGN                                                   !4, ''
   26     5        ASSIGN                                                   !5, 2
   27     6        ASSIGN                                                   !6, 3
   28     7        ASSIGN                                                   !7, 2
   30     8        INIT_FCALL                                               'ceil'
          9        DIV                                              ~22     !2, !3
         10        SEND_VAL                                                 ~22
         11        DO_ICALL                                         $23     
         12        ASSIGN                                                   !8, $23
   31    13        IS_SMALLER                                               1, !8
         14      > JMPZ                                                     ~25, ->61
   46    15    >   DIV                                              ~26     !6, 2
         16        CAST                                          4  ~27     ~26
         17        SUB                                              ~28     !0, ~27
         18        SUB                                              ~29     ~28, 1
         19        ASSIGN                                                   !9, ~29
   47    20        IS_SMALLER                                               !9, 0
         21      > JMPZ                                                     ~31, ->23
         22    >   ASSIGN                                                   !9, 0
   49    23    >   DIV                                              ~33     !6, 2
         24        CAST                                          4  ~34     ~33
         25        ADD                                              ~35     !0, ~34
         26        ADD                                              ~36     ~35, 1
         27        ASSIGN                                                   !10, ~36
   50    28        IS_SMALLER                                               !8, !10
         29      > JMPZ                                                     ~38, ->31
         30    >   ASSIGN                                                   !10, !8
   52    31    >   IS_SMALLER_OR_EQUAL                              ~40     0, !0
         32      > JMPZ_EX                                          ~40     ~40, ->38
         33    >   DIV                                              ~41     !6, 2
         34        CAST                                          4  ~42     ~41
         35        ADD                                              ~43     !5, ~42
         36        IS_SMALLER_OR_EQUAL                              ~44     !0, ~43
         37        BOOL                                             ~40     ~44
         38    > > JMPZ                                                     ~40, ->61
   53    39    >   ASSIGN                                                   !11, 0
         40      > JMP                                                      ->59
   54    41    >   MUL                                              ~46     !11, !3
         42        ASSIGN                                                   !12, ~46
   55    43        ADD                                              ~48     !11, 1
         44        ASSIGN                                                   !13, ~48
   56    45        IS_NOT_EQUAL                                             !12, !1
         46      > JMPZ                                                     ~50, ->55
   57    47    >   ROPE_INIT                                     3  ~52     'nmstart%3D'
         48        ROPE_ADD                                      1  ~52     ~52, !12
         49        ROPE_END                                      2  ~51     ~52, '%27%3E'
         50        CONCAT                                           ~54     '%0A%3Ca+class%3D%22nl_page%22+href%3D%27', ~51
         51        CONCAT                                           ~55     ~54, !13
         52        CONCAT                                           ~56     ~55, '%3C%2Fa%3E'
         53        ASSIGN_OP                                     8          !4, ~56
         54      > JMP                                                      ->58
   59    55    >   CONCAT                                           ~58     '%0A%3Cspan+class%3D%22nl_page+nl_page__currentpage%22%3E', !13
         56        CONCAT                                           ~59     ~58, '%3C%2Fspan%3E'
         57        ASSIGN_OP                                     8          !4, ~59
   53    58    >   PRE_INC                                                  !11
         59    >   IS_SMALLER                                               !11, !10
         60      > JMPNZ                                                    ~62, ->41
   65    61    >   INIT_FCALL                                               'var_dump'
         62        SEND_VAR                                                 !4
         63        DO_ICALL                                                 
   66    64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.77 ms | 1400 KiB | 17 Q