3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_reputation($user, $mode = '', $rep_is_on = TRUE, $post_id = 0) { global $INSTALLER09, $CURUSER; $member_reputation = ""; if ($rep_is_on) { include CACHE_DIR . '/rep_cache.php'; //require_once (CLASS_DIR . 'class_user_options.php'); // ok long winded file checking, but it's much better than file_exists if (!isset($reputations) || !is_array($reputations) || count($reputations) < 1) { return '<span title="Cache doesn\'t exist or zero length">Reputation: Offline</span>'; } $user['g_rep_hide'] = isset($user['g_rep_hide']) ? $user['g_rep_hide'] : 0; //$user['username'] = (($user['opt1'] & user_options::ANONYMOUS) ? $user['username'] : 'Anonymous'); $user['username'] = ($user['anonymous'] != 'yes') ? $user['username'] : 'Anonymous'; // Hmmm...bit of jiggery-pokery here, couldn't think of a better way. $max_rep = max(array_keys($reputations)); if ($user['reputation'] >= $max_rep) { $user_reputation = $reputations[$max_rep]; } else foreach ($reputations as $y => $x) { if ($y > $user['reputation']) { $user_reputation = $old; break; } $old = $x; } //$rep_is_on = TRUE; //$CURUSER['g_rep_hide'] = FALSE; $rep_power = $user['reputation']; $posneg = ''; if ($user['reputation'] == 0) { $rep_img = 'balance'; $rep_power = $user['reputation'] * -1; } elseif ($user['reputation'] < 0) { $rep_img = 'neg'; $rep_img_2 = 'highneg'; $rep_power = $user['reputation'] * -1; } else { $rep_img = 'pos'; $rep_img_2 = 'highpos'; } $pips = 12; switch ($mode) { case 'comments': $pips = 12; break; case 'torrents': $pips = 1003; break; case 'users': $pips = 970; break; case 'posts': $pips = 12; break; default: $pips = 12; // statusbar } $rep_bar = intval($rep_power / 100); if ($rep_bar > 10) { $rep_bar = 10; } if ($user['g_rep_hide']) // can set this to a group option if required, via admin? { $posneg = 'off'; $rep_level = 'rep_off'; } else { // it ain't off then, so get on with it! I wanna see shiny stuff!! $rep_level = $user_reputation ? $user_reputation : 'rep_undefined'; // just incase for ($i = 0; $i <= $rep_bar; $i++) { if ($i >= 5) { $posneg.= "<img src='pic/rep/reputation_$rep_img_2.gif' alt=\"Reputation Power $rep_power\n" . htmlsafechars($user['username']) . " $rep_level\" />"; } else { $posneg.= "<img src='pic/rep/reputation_$rep_img.gif' alt=\"Reputation Power $rep_power\n" . htmlsafechars($user['username']) . " $rep_level\" />"; } } } // now decide the locale if ($mode != '') return "Rep: " . $posneg . "<br /><br /><a href='javascript:;' onclick=\"PopUp('{$INSTALLER09['baseurl']}/reputation.php?pid=" . ($post_id != 0 ? (int)$post_id : (int)$user['id']) . "&amp;locale=" . $mode . "','Reputation',400,241,1,1);\"><button type='button' class='btn btn-default btn-xs' style='margin-top:-9px;' alt='Add reputation:: " . htmlsafechars($user['username']) . "' title='Add reputation:: " . htmlsafechars($user['username']) . "'><i class='fa fa-check'></i> Add Rep</button></a>"; else return " " . $posneg; } // END IF ONLINE // default return '<span title="Set offline by admin setting">Rep System Offline</span>'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y2v3M
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   84     0  E > > RETURN                                                   1

Function get_reputation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 200
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 53
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 75
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
6 jumps found. (Code = 188) Position 1 = 97, Position 2 = 99, Position 3 = 101, Position 4 = 103, Position 5 = 105, Position 6 = 88
Branch analysis from position: 97
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
2 jumps found. (Code = 43) Position 1 = 111, Position 2 = 112
Branch analysis from position: 111
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 117
Branch analysis from position: 114
1 jumps found. (Code = 42) Position 1 = 162
Branch analysis from position: 162
2 jumps found. (Code = 43) Position 1 = 164, Position 2 = 198
Branch analysis from position: 164
2 jumps found. (Code = 43) Position 1 = 172, Position 2 = 175
Branch analysis from position: 172
1 jumps found. (Code = 42) Position 1 = 178
Branch analysis from position: 178
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 175
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 198
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 117
2 jumps found. (Code = 43) Position 1 = 118, Position 2 = 120
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
1 jumps found. (Code = 42) Position 1 = 160
Branch analysis from position: 160
2 jumps found. (Code = 44) Position 1 = 162, Position 2 = 124
Branch analysis from position: 162
Branch analysis from position: 124
2 jumps found. (Code = 43) Position 1 = 126, Position 2 = 143
Branch analysis from position: 126
1 jumps found. (Code = 42) Position 1 = 159
Branch analysis from position: 159
2 jumps found. (Code = 44) Position 1 = 162, Position 2 = 124
Branch analysis from position: 162
Branch analysis from position: 124
Branch analysis from position: 143
2 jumps found. (Code = 44) Position 1 = 162, Position 2 = 124
Branch analysis from position: 162
Branch analysis from position: 124
Branch analysis from position: 120
1 jumps found. (Code = 42) Position 1 = 160
Branch analysis from position: 160
Branch analysis from position: 112
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
Branch analysis from position: 101
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
Branch analysis from position: 105
2 jumps found. (Code = 43) Position 1 = 111, Position 2 = 112
Branch analysis from position: 111
Branch analysis from position: 112
Branch analysis from position: 88
2 jumps found. (Code = 44) Position 1 = 90, Position 2 = 97
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 99
Branch analysis from position: 92
2 jumps found. (Code = 44) Position 1 = 94, Position 2 = 101
Branch analysis from position: 94
2 jumps found. (Code = 44) Position 1 = 96, Position 2 = 103
Branch analysis from position: 96
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
Branch analysis from position: 103
Branch analysis from position: 101
Branch analysis from position: 99
Branch analysis from position: 97
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 84
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
Branch analysis from position: 84
6 jumps found. (Code = 188) Position 1 = 97, Position 2 = 99, Position 3 = 101, Position 4 = 103, Position 5 = 105, Position 6 = 88
Branch analysis from position: 97
Branch analysis from position: 99
Branch analysis from position: 101
Branch analysis from position: 103
Branch analysis from position: 105
Branch analysis from position: 88
Branch analysis from position: 53
2 jumps found. (Code = 77) Position 1 = 54, Position 2 = 63
Branch analysis from position: 54
2 jumps found. (Code = 78) Position 1 = 55, Position 2 = 63
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 75
Branch analysis from position: 70
Branch analysis from position: 75
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 63
Branch analysis from position: 63
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 53
Branch analysis from position: 50
Branch analysis from position: 53
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
Branch analysis from position: 37
Branch analysis from position: 21
Branch analysis from position: 17
Branch analysis from position: 200
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y2v3M
function name:  get_reputation
number of ops:  202
compiled vars:  !0 = $user, !1 = $mode, !2 = $rep_is_on, !3 = $post_id, !4 = $INSTALLER09, !5 = $CURUSER, !6 = $member_reputation, !7 = $reputations, !8 = $max_rep, !9 = $user_reputation, !10 = $x, !11 = $y, !12 = $old, !13 = $rep_power, !14 = $posneg, !15 = $rep_img, !16 = $rep_img_2, !17 = $pips, !18 = $rep_bar, !19 = $rep_level, !20 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
          2        RECV_INIT                                        !2      <true>
          3        RECV_INIT                                        !3      0
    4     4        BIND_GLOBAL                                              !4, 'INSTALLER09'
          5        BIND_GLOBAL                                              !5, 'CURUSER'
    5     6        ASSIGN                                                   !6, ''
    6     7      > JMPZ                                                     !2, ->200
    7     8    >   FETCH_CONSTANT                                   ~22     'CACHE_DIR'
          9        CONCAT                                           ~23     ~22, '%2Frep_cache.php'
         10        INCLUDE_OR_EVAL                                          ~23, INCLUDE
   10    11        ISSET_ISEMPTY_CV                                 ~25     !7
         12        BOOL_NOT                                         ~26     ~25
         13      > JMPNZ_EX                                         ~26     ~26, ->17
         14    >   TYPE_CHECK                                  128  ~27     !7
         15        BOOL_NOT                                         ~28     ~27
         16        BOOL                                             ~26     ~28
         17    > > JMPNZ_EX                                         ~26     ~26, ->21
         18    >   COUNT                                            ~29     !7
         19        IS_SMALLER                                       ~30     ~29, 1
         20        BOOL                                             ~26     ~30
         21    > > JMPZ                                                     ~26, ->23
   11    22    > > RETURN                                                   '%3Cspan+title%3D%22Cache+doesn%27t+exist+or+zero+length%22%3EReputation%3A+Offline%3C%2Fspan%3E'
   13    23    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'g_rep_hide'
         24      > JMPZ                                                     ~32, ->28
         25    >   FETCH_DIM_R                                      ~33     !0, 'g_rep_hide'
         26        QM_ASSIGN                                        ~34     ~33
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~34     0
         29    >   ASSIGN_DIM                                               !0, 'g_rep_hide'
         30        OP_DATA                                                  ~34
   15    31        FETCH_DIM_R                                      ~36     !0, 'anonymous'
         32        IS_NOT_EQUAL                                             ~36, 'yes'
         33      > JMPZ                                                     ~37, ->37
         34    >   FETCH_DIM_R                                      ~38     !0, 'username'
         35        QM_ASSIGN                                        ~39     ~38
         36      > JMP                                                      ->38
         37    >   QM_ASSIGN                                        ~39     'Anonymous'
         38    >   ASSIGN_DIM                                               !0, 'username'
         39        OP_DATA                                                  ~39
   17    40        INIT_FCALL                                               'max'
         41        INIT_FCALL                                               'array_keys'
         42        SEND_VAR                                                 !7
         43        DO_ICALL                                         $40     
         44        SEND_VAR                                                 $40
         45        DO_ICALL                                         $41     
         46        ASSIGN                                                   !8, $41
   18    47        FETCH_DIM_R                                      ~43     !0, 'reputation'
         48        IS_SMALLER_OR_EQUAL                                      !8, ~43
         49      > JMPZ                                                     ~44, ->53
   19    50    >   FETCH_DIM_R                                      ~45     !7, !8
         51        ASSIGN                                                   !9, ~45
         52      > JMP                                                      ->64
   20    53    > > FE_RESET_R                                       $47     !7, ->63
         54    > > FE_FETCH_R                                       ~48     $47, !10, ->63
         55    >   ASSIGN                                                   !11, ~48
   21    56        FETCH_DIM_R                                      ~50     !0, 'reputation'
         57        IS_SMALLER                                               ~50, !11
         58      > JMPZ                                                     ~51, ->61
   22    59    >   ASSIGN                                                   !9, !12
   23    60      > JMP                                                      ->63
   25    61    >   ASSIGN                                                   !12, !10
   20    62      > JMP                                                      ->54
         63    >   FE_FREE                                                  $47
   29    64    >   FETCH_DIM_R                                      ~54     !0, 'reputation'
         65        ASSIGN                                                   !13, ~54
   30    66        ASSIGN                                                   !14, ''
   32    67        FETCH_DIM_R                                      ~57     !0, 'reputation'
         68        IS_EQUAL                                                 ~57, 0
         69      > JMPZ                                                     ~58, ->75
   33    70    >   ASSIGN                                                   !15, 'balance'
   34    71        FETCH_DIM_R                                      ~60     !0, 'reputation'
         72        MUL                                              ~61     ~60, -1
         73        ASSIGN                                                   !13, ~61
         74      > JMP                                                      ->86
   35    75    >   FETCH_DIM_R                                      ~63     !0, 'reputation'
         76        IS_SMALLER                                               ~63, 0
         77      > JMPZ                                                     ~64, ->84
   36    78    >   ASSIGN                                                   !15, 'neg'
   37    79        ASSIGN                                                   !16, 'highneg'
   38    80        FETCH_DIM_R                                      ~67     !0, 'reputation'
         81        MUL                                              ~68     ~67, -1
         82        ASSIGN                                                   !13, ~68
         83      > JMP                                                      ->86
   40    84    >   ASSIGN                                                   !15, 'pos'
   41    85        ASSIGN                                                   !16, 'highpos'
   43    86    >   ASSIGN                                                   !17, 12
   44    87      > SWITCH_STRING                                            !1, [ 'comments':->97, 'torrents':->99, 'users':->101, 'posts':->103, ], ->105
   45    88    >   IS_EQUAL                                                 !1, 'comments'
         89      > JMPNZ                                                    ~73, ->97
   48    90    >   IS_EQUAL                                                 !1, 'torrents'
         91      > JMPNZ                                                    ~73, ->99
   51    92    >   IS_EQUAL                                                 !1, 'users'
         93      > JMPNZ                                                    ~73, ->101
   54    94    >   IS_EQUAL                                                 !1, 'posts'
         95      > JMPNZ                                                    ~73, ->103
         96    > > JMP                                                      ->105
   46    97    >   ASSIGN                                                   !17, 12
   47    98      > JMP                                                      ->106
   49    99    >   ASSIGN                                                   !17, 1003
   50   100      > JMP                                                      ->106
   52   101    >   ASSIGN                                                   !17, 970
   53   102      > JMP                                                      ->106
   55   103    >   ASSIGN                                                   !17, 12
   56   104      > JMP                                                      ->106
   58   105    >   ASSIGN                                                   !17, 12
   60   106    >   DIV                                              ~79     !13, 100
        107        CAST                                          4  ~80     ~79
        108        ASSIGN                                                   !18, ~80
   61   109        IS_SMALLER                                               10, !18
        110      > JMPZ                                                     ~82, ->112
   62   111    >   ASSIGN                                                   !18, 10
   64   112    >   FETCH_DIM_R                                      ~84     !0, 'g_rep_hide'
        113      > JMPZ                                                     ~84, ->117
   66   114    >   ASSIGN                                                   !14, 'off'
   67   115        ASSIGN                                                   !19, 'rep_off'
        116      > JMP                                                      ->162
   69   117    > > JMPZ                                                     !9, ->120
        118    >   QM_ASSIGN                                        ~87     !9
        119      > JMP                                                      ->121
        120    >   QM_ASSIGN                                        ~87     'rep_undefined'
        121    >   ASSIGN                                                   !19, ~87
   70   122        ASSIGN                                                   !20, 0
        123      > JMP                                                      ->160
   71   124    >   IS_SMALLER_OR_EQUAL                                      5, !20
        125      > JMPZ                                                     ~90, ->143
   72   126    >   ROPE_INIT                                     5  ~92     '%3Cimg+src%3D%27pic%2Frep%2Freputation_'
        127        ROPE_ADD                                      1  ~92     ~92, !16
        128        ROPE_ADD                                      2  ~92     ~92, '.gif%27+alt%3D%22Reputation+Power+'
        129        ROPE_ADD                                      3  ~92     ~92, !13
        130        ROPE_END                                      4  ~91     ~92, '%0A'
        131        INIT_FCALL_BY_NAME                                       'htmlsafechars'
        132        CHECK_FUNC_ARG                                           
        133        FETCH_DIM_FUNC_ARG                               $95     !0, 'username'
        134        SEND_FUNC_ARG                                            $95
        135        DO_FCALL                                      0  $96     
        136        CONCAT                                           ~97     ~91, $96
        137        ROPE_INIT                                     3  ~99     '+'
        138        ROPE_ADD                                      1  ~99     ~99, !19
        139        ROPE_END                                      2  ~98     ~99, '%22+%2F%3E'
        140        CONCAT                                           ~101    ~97, ~98
        141        ASSIGN_OP                                     8          !14, ~101
        142      > JMP                                                      ->159
   74   143    >   ROPE_INIT                                     5  ~104    '%3Cimg+src%3D%27pic%2Frep%2Freputation_'
        144        ROPE_ADD                                      1  ~104    ~104, !15
        145        ROPE_ADD                                      2  ~104    ~104, '.gif%27+alt%3D%22Reputation+Power+'
        146        ROPE_ADD                                      3  ~104    ~104, !13
        147        ROPE_END                                      4  ~103    ~104, '%0A'
        148        INIT_FCALL_BY_NAME                                       'htmlsafechars'
        149        CHECK_FUNC_ARG                                           
        150        FETCH_DIM_FUNC_ARG                               $107    !0, 'username'
        151        SEND_FUNC_ARG                                            $107
        152        DO_FCALL                                      0  $108    
        153        CONCAT                                           ~109    ~103, $108
        154        ROPE_INIT                                     3  ~111    '+'
        155        ROPE_ADD                                      1  ~111    ~111, !19
        156        ROPE_END                                      2  ~110    ~111, '%22+%2F%3E'
        157        CONCAT                                           ~113    ~109, ~110
        158        ASSIGN_OP                                     8          !14, ~113
   70   159    >   PRE_INC                                                  !20
        160    >   IS_SMALLER_OR_EQUAL                                      !20, !18
        161      > JMPNZ                                                    ~116, ->124
   79   162    >   IS_NOT_EQUAL                                             !1, ''
        163      > JMPZ                                                     ~117, ->198
        164    >   CONCAT                                           ~118    'Rep%3A+', !14
        165        ROPE_INIT                                     3  ~121    '%3Cbr+%2F%3E%3Cbr+%2F%3E%3Ca+href%3D%27javascript%3A%3B%27+onclick%3D%22PopUp%28%27'
        166        FETCH_DIM_R                                      ~119    !4, 'baseurl'
        167        ROPE_ADD                                      1  ~121    ~121, ~119
        168        ROPE_END                                      2  ~120    ~121, '%2Freputation.php%3Fpid%3D'
        169        CONCAT                                           ~123    ~118, ~120
        170        IS_NOT_EQUAL                                             !3, 0
        171      > JMPZ                                                     ~124, ->175
        172    >   CAST                                          4  ~125    !3
        173        QM_ASSIGN                                        ~126    ~125
        174      > JMP                                                      ->178
        175    >   FETCH_DIM_R                                      ~127    !0, 'id'
        176        CAST                                          4  ~128    ~127
        177        QM_ASSIGN                                        ~126    ~128
        178    >   CONCAT                                           ~129    ~123, ~126
        179        CONCAT                                           ~130    ~129, '%26amp%3Blocale%3D'
        180        CONCAT                                           ~131    ~130, !1
        181        CONCAT                                           ~132    ~131, '%27%2C%27Reputation%27%2C400%2C241%2C1%2C1%29%3B%22%3E%3Cbutton+type%3D%27button%27+class%3D%27btn+btn-default+btn-xs%27+style%3D%27margin-top%3A-9px%3B%27+alt%3D%27Add+reputation%3A%3A+'
        182        INIT_FCALL_BY_NAME                                       'htmlsafechars'
        183        CHECK_FUNC_ARG                                           
        184        FETCH_DIM_FUNC_ARG                               $133    !0, 'username'
        185        SEND_FUNC_ARG                                            $133
        186        DO_FCALL                                      0  $134    
        187        CONCAT                                           ~135    ~132, $134
        188        CONCAT                                           ~136    ~135, '%27+title%3D%27Add+reputation%3A%3A+'
        189        INIT_FCALL_BY_NAME                                       'htmlsafechars'
        190        CHECK_FUNC_ARG                                           
        191        FETCH_DIM_FUNC_ARG                               $137    !0, 'username'
        192        SEND_FUNC_ARG                                            $137
        193        DO_FCALL                                      0  $138    
        194        CONCAT                                           ~139    ~136, $138
        195        CONCAT                                           ~140    ~139, '%27%3E%3Ci+class%3D%27fa+fa-check%27%3E%3C%2Fi%3E+Add+Rep%3C%2Fbutton%3E%3C%2Fa%3E'
        196      > RETURN                                                   ~140
        197*       JMP                                                      ->200
   80   198    >   CONCAT                                           ~141    '+', !14
        199      > RETURN                                                   ~141
   83   200    > > RETURN                                                   '%3Cspan+title%3D%22Set+offline+by+admin+setting%22%3ERep+System+Offline%3C%2Fspan%3E'
   84   201*     > RETURN                                                   null

End of function get_reputation

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.18 ms | 1420 KiB | 17 Q