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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.86 ms | 1400 KiB | 19 Q