3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c_query{ public function query($sqlfind,$rowsPerPage=2,$pageNum=1,$range=2,$order="ASC",$style="grey") { if(isset($_GET['page'])){ $pageNum = $_GET['page'];} $offset = ($pageNum - 1) * $rowsPerPage; $sql = mysql_query("$sqlfind ORDER BY `id` $order LIMIT $offset, $rowsPerPage"); $sql1total = mysql_query("$sqlfind ORDER BY `id` $order"); $numrows = mysql_num_rows($sql1total); $maxPage = ceil($numrows /$rowsPerPage); $self = $_SERVER['PHP_SELF']."?"; $nav = '';if ($numrows > 0){ $first = "<span class=\"pages $style active\">Page: $pageNum of $maxPage</span>"; } if($pageNum > $range+1){$min5 = $pageNum-$range;}else{$min5 = 1;} if($pageNum > 1){for($page = $min5; $page < $pageNum; $page++){$nav .= "&nbsp;<a class=\"pages $style ahref\" href=\"$self"."page=$page\">$page</a>";}} $max5 = $pageNum+$range; if($max5 > $maxPage){$max5 = $maxPage;} for($page = $pageNum; $page <= $max5; $page++){ if ($page == $pageNum){ $nav .= " <span class=\"pages $style active\">$page</span>"; }else{$nav .= "&nbsp;<a class=\"pages $style ahref\" href=\"$self"."page=$page\">$page</a>"; }} if($maxPage == 1){$nav = "";} if ($pageNum > 1){$page = $pageNum - $range-1; if($page < 1){$page = 1;} $prev = " <a class=\"pages $style ahref\" href=\"$self&page=$page\"><</a> "; $first .= " <a class=\"pages $style ahref\" href=\"$self"."page=1\">First</a> "; }else{$prev = '&nbsp;';$first .= '&nbsp;'; } if ($pageNum < $maxPage){$page = $pageNum + $range+1; if($page > $maxPage){$page = $maxPage;} $next = " <a class=\"pages $style ahref\" href=\"$self&page=$page\">></a> ";$last = " <a class=\"pages $style ahref\" href=\"$self"."page=$maxPage\">Last</a> ";}else{$next = '&nbsp;';$last = '&nbsp;';} $this->pages = "<div id=\"pagination\">$first $prev $nav $next $last</div>"; $this->queryarr = $sql; } } $query = new c_query(); $query->query("SELECT * FROM `table`",1,1,1,"ASC","blue circle"); echo "$query->pages <br>"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DmA0S
function name:  (null)
number of ops:  16
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'c_query'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'query'
          4        SEND_VAL_EX                                              'SELECT+%2A+FROM+%60table%60'
          5        SEND_VAL_EX                                              1
          6        SEND_VAL_EX                                              1
          7        SEND_VAL_EX                                              1
          8        SEND_VAL_EX                                              'ASC'
          9        SEND_VAL_EX                                              'blue+circle'
         10        DO_FCALL                                      0          
   27    11        FETCH_OBJ_R                                      ~5      !0, 'pages'
         12        NOP                                                      
         13        FAST_CONCAT                                      ~6      ~5, '+%3Cbr%3E'
         14        ECHO                                                     ~6
   28    15      > RETURN                                                   1

Class c_query:
Function query:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 57
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 82
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
2 jumps found. (Code = 44) Position 1 = 82, Position 2 = 68
Branch analysis from position: 82
2 jumps found. (Code = 43) Position 1 = 86, Position 2 = 87
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
2 jumps found. (Code = 44) Position 1 = 112, Position 2 = 89
Branch analysis from position: 112
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 115
Branch analysis from position: 114
2 jumps found. (Code = 43) Position 1 = 117, Position 2 = 138
Branch analysis from position: 117
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 123
Branch analysis from position: 122
1 jumps found. (Code = 42) Position 1 = 140
Branch analysis from position: 140
2 jumps found. (Code = 43) Position 1 = 142, Position 2 = 166
Branch analysis from position: 142
2 jumps found. (Code = 43) Position 1 = 147, Position 2 = 148
Branch analysis from position: 147
1 jumps found. (Code = 42) Position 1 = 168
Branch analysis from position: 168
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 148
Branch analysis from position: 166
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 123
Branch analysis from position: 138
2 jumps found. (Code = 43) Position 1 = 142, Position 2 = 166
Branch analysis from position: 142
Branch analysis from position: 166
Branch analysis from position: 115
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 91, Position 2 = 98
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 109
Branch analysis from position: 109
2 jumps found. (Code = 44) Position 1 = 112, Position 2 = 89
Branch analysis from position: 112
Branch analysis from position: 89
Branch analysis from position: 98
2 jumps found. (Code = 44) Position 1 = 112, Position 2 = 89
Branch analysis from position: 112
Branch analysis from position: 89
Branch analysis from position: 87
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 82, Position 2 = 68
Branch analysis from position: 82
Branch analysis from position: 68
Branch analysis from position: 82
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 82
Branch analysis from position: 66
Branch analysis from position: 82
Branch analysis from position: 57
Branch analysis from position: 12
filename:       /in/DmA0S
function name:  query
number of ops:  184
compiled vars:  !0 = $sqlfind, !1 = $rowsPerPage, !2 = $pageNum, !3 = $range, !4 = $order, !5 = $style, !6 = $offset, !7 = $sql, !8 = $sql1total, !9 = $numrows, !10 = $maxPage, !11 = $self, !12 = $nav, !13 = $first, !14 = $min5, !15 = $page, !16 = $max5, !17 = $prev, !18 = $next, !19 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      2
          2        RECV_INIT                                        !2      1
          3        RECV_INIT                                        !3      2
          4        RECV_INIT                                        !4      'ASC'
          5        RECV_INIT                                        !5      'grey'
    4     6        FETCH_IS                                         ~20     '_GET'
          7        ISSET_ISEMPTY_DIM_OBJ                         0          ~20, 'page'
          8      > JMPZ                                                     ~21, ->12
          9    >   FETCH_R                      global              ~22     '_GET'
         10        FETCH_DIM_R                                      ~23     ~22, 'page'
         11        ASSIGN                                                   !2, ~23
    5    12    >   SUB                                              ~25     !2, 1
         13        MUL                                              ~26     !1, ~25
         14        ASSIGN                                                   !6, ~26
    6    15        INIT_FCALL_BY_NAME                                       'mysql_query'
         16        ROPE_INIT                                     7  ~29     !0
         17        ROPE_ADD                                      1  ~29     ~29, '+ORDER+BY+%60id%60+'
         18        ROPE_ADD                                      2  ~29     ~29, !4
         19        ROPE_ADD                                      3  ~29     ~29, '+LIMIT+'
         20        ROPE_ADD                                      4  ~29     ~29, !6
         21        ROPE_ADD                                      5  ~29     ~29, '%2C+'
         22        ROPE_END                                      6  ~28     ~29, !1
         23        SEND_VAL_EX                                              ~28
         24        DO_FCALL                                      0  $33     
         25        ASSIGN                                                   !7, $33
    7    26        INIT_FCALL_BY_NAME                                       'mysql_query'
         27        ROPE_INIT                                     3  ~36     !0
         28        ROPE_ADD                                      1  ~36     ~36, '+ORDER+BY+%60id%60+'
         29        ROPE_END                                      2  ~35     ~36, !4
         30        SEND_VAL_EX                                              ~35
         31        DO_FCALL                                      0  $38     
         32        ASSIGN                                                   !8, $38
    8    33        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         34        SEND_VAR_EX                                              !8
         35        DO_FCALL                                      0  $40     
         36        ASSIGN                                                   !9, $40
    9    37        INIT_FCALL                                               'ceil'
         38        DIV                                              ~42     !9, !1
         39        SEND_VAL                                                 ~42
         40        DO_ICALL                                         $43     
         41        ASSIGN                                                   !10, $43
   10    42        FETCH_R                      global              ~45     '_SERVER'
         43        FETCH_DIM_R                                      ~46     ~45, 'PHP_SELF'
         44        CONCAT                                           ~47     ~46, '%3F'
         45        ASSIGN                                                   !11, ~47
   11    46        ASSIGN                                                   !12, ''
         47        IS_SMALLER                                               0, !9
         48      > JMPZ                                                     ~50, ->57
         49    >   ROPE_INIT                                     7  ~52     '%3Cspan+class%3D%22pages+'
         50        ROPE_ADD                                      1  ~52     ~52, !5
         51        ROPE_ADD                                      2  ~52     ~52, '+active%22%3EPage%3A+'
         52        ROPE_ADD                                      3  ~52     ~52, !2
         53        ROPE_ADD                                      4  ~52     ~52, '+of+'
         54        ROPE_ADD                                      5  ~52     ~52, !10
         55        ROPE_END                                      6  ~51     ~52, '%3C%2Fspan%3E'
         56        ASSIGN                                                   !13, ~51
   12    57    >   ADD                                              ~57     !3, 1
         58        IS_SMALLER                                               ~57, !2
         59      > JMPZ                                                     ~58, ->63
         60    >   SUB                                              ~59     !2, !3
         61        ASSIGN                                                   !14, ~59
         62      > JMP                                                      ->64
         63    >   ASSIGN                                                   !14, 1
   13    64    >   IS_SMALLER                                               1, !2
         65      > JMPZ                                                     ~62, ->82
         66    >   ASSIGN                                                   !15, !14
         67      > JMP                                                      ->80
         68    >   ROPE_INIT                                     4  ~65     '%26nbsp%3B%3Ca+class%3D%22pages+'
         69        ROPE_ADD                                      1  ~65     ~65, !5
         70        ROPE_ADD                                      2  ~65     ~65, '+ahref%22+href%3D%22'
         71        ROPE_END                                      3  ~64     ~65, !11
         72        ROPE_INIT                                     5  ~68     'page%3D'
         73        ROPE_ADD                                      1  ~68     ~68, !15
         74        ROPE_ADD                                      2  ~68     ~68, '%22%3E'
         75        ROPE_ADD                                      3  ~68     ~68, !15
         76        ROPE_END                                      4  ~67     ~68, '%3C%2Fa%3E'
         77        CONCAT                                           ~71     ~64, ~67
         78        ASSIGN_OP                                     8          !12, ~71
         79        PRE_INC                                                  !15
         80    >   IS_SMALLER                                               !15, !2
         81      > JMPNZ                                                    ~74, ->68
   14    82    >   ADD                                              ~75     !2, !3
         83        ASSIGN                                                   !16, ~75
         84        IS_SMALLER                                               !10, !16
         85      > JMPZ                                                     ~77, ->87
         86    >   ASSIGN                                                   !16, !10
   15    87    >   ASSIGN                                                   !15, !2
         88      > JMP                                                      ->110
   16    89    >   IS_EQUAL                                                 !15, !2
         90      > JMPZ                                                     ~80, ->98
         91    >   ROPE_INIT                                     5  ~82     '+%3Cspan+class%3D%22pages+'
         92        ROPE_ADD                                      1  ~82     ~82, !5
         93        ROPE_ADD                                      2  ~82     ~82, '+active%22%3E'
         94        ROPE_ADD                                      3  ~82     ~82, !15
         95        ROPE_END                                      4  ~81     ~82, '%3C%2Fspan%3E'
         96        ASSIGN_OP                                     8          !12, ~81
         97      > JMP                                                      ->109
         98    >   ROPE_INIT                                     4  ~87     '%26nbsp%3B%3Ca+class%3D%22pages+'
         99        ROPE_ADD                                      1  ~87     ~87, !5
        100        ROPE_ADD                                      2  ~87     ~87, '+ahref%22++href%3D%22'
        101        ROPE_END                                      3  ~86     ~87, !11
        102        ROPE_INIT                                     5  ~90     'page%3D'
        103        ROPE_ADD                                      1  ~90     ~90, !15
        104        ROPE_ADD                                      2  ~90     ~90, '%22%3E'
        105        ROPE_ADD                                      3  ~90     ~90, !15
        106        ROPE_END                                      4  ~89     ~90, '%3C%2Fa%3E'
        107        CONCAT                                           ~93     ~86, ~89
        108        ASSIGN_OP                                     8          !12, ~93
   15   109    >   PRE_INC                                                  !15
        110    >   IS_SMALLER_OR_EQUAL                                      !15, !16
        111      > JMPNZ                                                    ~96, ->89
   17   112    >   IS_EQUAL                                                 !10, 1
        113      > JMPZ                                                     ~97, ->115
        114    >   ASSIGN                                                   !12, ''
   18   115    >   IS_SMALLER                                               1, !2
        116      > JMPZ                                                     ~99, ->138
        117    >   SUB                                              ~100    !2, !3
        118        SUB                                              ~101    ~100, 1
        119        ASSIGN                                                   !15, ~101
        120        IS_SMALLER                                               !15, 1
        121      > JMPZ                                                     ~103, ->123
        122    >   ASSIGN                                                   !15, 1
        123    >   ROPE_INIT                                     7  ~106    '+%3Ca+class%3D%22pages+'
        124        ROPE_ADD                                      1  ~106    ~106, !5
        125        ROPE_ADD                                      2  ~106    ~106, '+ahref%22++href%3D%22'
        126        ROPE_ADD                                      3  ~106    ~106, !11
        127        ROPE_ADD                                      4  ~106    ~106, '%26page%3D'
        128        ROPE_ADD                                      5  ~106    ~106, !15
        129        ROPE_END                                      6  ~105    ~106, '%22%3E%3C%3C%2Fa%3E+'
        130        ASSIGN                                                   !17, ~105
        131        ROPE_INIT                                     4  ~112    '+%3Ca+class%3D%22pages+'
        132        ROPE_ADD                                      1  ~112    ~112, !5
        133        ROPE_ADD                                      2  ~112    ~112, '+ahref%22+href%3D%22'
        134        ROPE_END                                      3  ~111    ~112, !11
        135        CONCAT                                           ~114    ~111, 'page%3D1%22%3EFirst%3C%2Fa%3E+'
        136        ASSIGN_OP                                     8          !13, ~114
        137      > JMP                                                      ->140
   19   138    >   ASSIGN                                                   !17, '%26nbsp%3B'
        139        ASSIGN_OP                                     8          !13, '%26nbsp%3B'
   20   140    >   IS_SMALLER                                               !2, !10
        141      > JMPZ                                                     ~118, ->166
        142    >   ADD                                              ~119    !2, !3
        143        ADD                                              ~120    ~119, 1
        144        ASSIGN                                                   !15, ~120
        145        IS_SMALLER                                               !10, !15
        146      > JMPZ                                                     ~122, ->148
        147    >   ASSIGN                                                   !15, !10
        148    >   ROPE_INIT                                     7  ~125    '+%3Ca+class%3D%22pages+'
        149        ROPE_ADD                                      1  ~125    ~125, !5
        150        ROPE_ADD                                      2  ~125    ~125, '+ahref%22+href%3D%22'
        151        ROPE_ADD                                      3  ~125    ~125, !11
        152        ROPE_ADD                                      4  ~125    ~125, '%26page%3D'
        153        ROPE_ADD                                      5  ~125    ~125, !15
        154        ROPE_END                                      6  ~124    ~125, '%22%3E%3E%3C%2Fa%3E+'
        155        ASSIGN                                                   !18, ~124
        156        ROPE_INIT                                     4  ~131    '+%3Ca+class%3D%22pages+'
        157        ROPE_ADD                                      1  ~131    ~131, !5
        158        ROPE_ADD                                      2  ~131    ~131, '+ahref%22+href%3D%22'
        159        ROPE_END                                      3  ~130    ~131, !11
        160        ROPE_INIT                                     3  ~134    'page%3D'
        161        ROPE_ADD                                      1  ~134    ~134, !10
        162        ROPE_END                                      2  ~133    ~134, '%22%3ELast%3C%2Fa%3E+'
        163        CONCAT                                           ~136    ~130, ~133
        164        ASSIGN                                                   !19, ~136
        165      > JMP                                                      ->168
        166    >   ASSIGN                                                   !18, '%26nbsp%3B'
        167        ASSIGN                                                   !19, '%26nbsp%3B'
   21   168    >   ROPE_INIT                                    11  ~142    '%3Cdiv+id%3D%22pagination%22%3E'
        169        ROPE_ADD                                      1  ~142    ~142, !13
        170        ROPE_ADD                                      2  ~142    ~142, '+'
        171        ROPE_ADD                                      3  ~142    ~142, !17
        172        ROPE_ADD                                      4  ~142    ~142, '+'
        173        ROPE_ADD                                      5  ~142    ~142, !12
        174        ROPE_ADD                                      6  ~142    ~142, '+'
        175        ROPE_ADD                                      7  ~142    ~142, !18
        176        ROPE_ADD                                      8  ~142    ~142, '+'
        177        ROPE_ADD                                      9  ~142    ~142, !19
        178        ROPE_END                                     10  ~141    ~142, '%3C%2Fdiv%3E'
        179        ASSIGN_OBJ                                               'pages'
        180        OP_DATA                                                  ~141
   22   181        ASSIGN_OBJ                                               'queryarr'
        182        OP_DATA                                                  !7
   23   183      > RETURN                                                   null

End of function query

End of class c_query.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.95 ms | 1416 KiB | 15 Q