3v4l.org

run code in 300+ PHP versions simultaneously
<?php //============================================= MY_MESSAGES.PHP //----------------------------------------------------------- include ("includes/header.php"); ?> <h2>My Unread Messages:</h2><p /> <? //-------------- SPACE -- Grab the messages for the logged in user $grab_messages = $dbh->prepare("SELECT * FROM pvt_messages WHERE user_to=:user && opened='no' && deleted='no'"); $grab_messages->bindValue(':user', $user, PDO::PARAM_STR); $grab_messages->execute(); $numrows = $grab_messages->fetch(PDO::FETCH_ASSOC); //-------------- SPACE if ($numrows != 0) { while ($get_msg = $grab_messages->fetch(PDO::FETCH_ASSOC)){ echo "--".$id = $get_msg['id']; $user_from = $get_msg['user_from']; $user_to = $get_msg['user_to']; $msg_title = $get_msg['msg_title']; $msg_body = $get_msg['msg_body']; $date = $get_msg['date']; $opened = $get_msg['opened']; $deleted = $get_msg['deleted']; ?> <script language="javascript"> function toggle<? echo $id; ?>() { var ele = document.getElementById("toggleText<? echo $id; ?>"); var text = document.getElementById("displayText<? echo $id; ?>"); if (ele.style.display == "block") { ele.style.display = "none"; } else { ele.style.display = "block"; } } </script> <? if (strlen($msg_title) > 50) { $msg_title = substr($msg_title, 0, 50)." ..."; } else $msg_title = $msg_title; if (strlen($msg_body) > 150) { $msg_body = substr($msg_body, 0, 150)." ..."; } else $msg_body = $msg_body; if (@$_POST['setopened_' . $id . '']) { //-------------- SPACE -- Update the private messages table $setopened_query = $dbh->prepare("UPDATE pvt_messages SET opened='yes' WHERE id=:id"); $setopened_query->bindValue(':id', $id, PDO::PARAM_STR); $setopened_query->execute(); } echo " <form method='POST' action='my_messages.php' name='$msg_title'> <b><a href='$user_from'>$user_from</a></b> <input type='button' name='openmsg' value='$msg_title' onClick='javascript:toggle$id()'> <input type='submit' name='setopened_$id' value=\"I've Read This\"> </form> <div id='toggleText$id' style='display: none;'> <br />$msg_body </div> <hr /><br /> "; } } else { echo "You haven't read any messages yet."; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 111
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
2 jumps found. (Code = 44) Position 1 = 110, Position 2 = 20
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 112
Branch analysis from position: 112
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 56
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 68
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 87
Branch analysis from position: 76
2 jumps found. (Code = 44) Position 1 = 110, Position 2 = 20
Branch analysis from position: 110
Branch analysis from position: 20
Branch analysis from position: 87
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 87
Branch analysis from position: 76
Branch analysis from position: 87
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 68
Branch analysis from position: 60
Branch analysis from position: 68
Branch analysis from position: 111
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OA7fB
function name:  (null)
number of ops:  113
compiled vars:  !0 = $grab_messages, !1 = $dbh, !2 = $user, !3 = $numrows, !4 = $id, !5 = $get_msg, !6 = $user_from, !7 = $user_to, !8 = $msg_title, !9 = $msg_body, !10 = $date, !11 = $opened, !12 = $deleted, !13 = $setopened_query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INCLUDE_OR_EVAL                                          'includes%2Fheader.php', INCLUDE
   10     1        ECHO                                                     '%0A++++%3Ch2%3EMy+Unread+Messages%3A%3C%2Fh2%3E%3Cp+%2F%3E%0A%0A'
   17     2        INIT_METHOD_CALL                                         !1, 'prepare'
          3        SEND_VAL_EX                                              'SELECT+%2A+FROM+pvt_messages+WHERE+user_to%3D%3Auser+%26%26+opened%3D%27no%27+%26%26+deleted%3D%27no%27'
          4        DO_FCALL                                      0  $15     
          5        ASSIGN                                                   !0, $15
   19     6        INIT_METHOD_CALL                                         !0, 'bindValue'
          7        SEND_VAL_EX                                              '%3Auser'
          8        SEND_VAR_EX                                              !2
          9        SEND_VAL_EX                                              2
         10        DO_FCALL                                      0          
   21    11        INIT_METHOD_CALL                                         !0, 'execute'
         12        DO_FCALL                                      0          
   23    13        INIT_METHOD_CALL                                         !0, 'fetch'
         14        SEND_VAL_EX                                              2
         15        DO_FCALL                                      0  $19     
         16        ASSIGN                                                   !3, $19
   27    17        IS_NOT_EQUAL                                             !3, 0
         18      > JMPZ                                                     ~21, ->111
   29    19    > > JMP                                                      ->105
   31    20    >   FETCH_DIM_R                                      ~22     !5, 'id'
         21        ASSIGN                                           ~23     !4, ~22
         22        CONCAT                                           ~24     '--', ~23
         23        ECHO                                                     ~24
   33    24        FETCH_DIM_R                                      ~25     !5, 'user_from'
         25        ASSIGN                                                   !6, ~25
   35    26        FETCH_DIM_R                                      ~27     !5, 'user_to'
         27        ASSIGN                                                   !7, ~27
   37    28        FETCH_DIM_R                                      ~29     !5, 'msg_title'
         29        ASSIGN                                                   !8, ~29
   39    30        FETCH_DIM_R                                      ~31     !5, 'msg_body'
         31        ASSIGN                                                   !9, ~31
   41    32        FETCH_DIM_R                                      ~33     !5, 'date'
         33        ASSIGN                                                   !10, ~33
   43    34        FETCH_DIM_R                                      ~35     !5, 'opened'
         35        ASSIGN                                                   !11, ~35
   45    36        FETCH_DIM_R                                      ~37     !5, 'deleted'
         37        ASSIGN                                                   !12, ~37
   48    38        ECHO                                                     '%0A++++++++%3Cscript+language%3D%22javascript%22%3E%0A%0A++++++++++++function+toggle'
   51    39        ECHO                                                     !4
         40        ECHO                                                     '%28%29+%7B%0A%0A++++++++++++++++var+ele+%3D+document.getElementById%28%22toggleText'
   53    41        ECHO                                                     !4
         42        ECHO                                                     '%22%29%3B%0A%0A++++++++++++++++var+text+%3D+document.getElementById%28%22displayText'
   55    43        ECHO                                                     !4
         44        ECHO                                                     '%22%29%3B%0A%0A++++++++++++++++if+%28ele.style.display+%3D%3D+%22block%22%29+%7B%0A%0A++++++++++++++++++++ele.style.display+%3D+%22none%22%3B%0A%0A++++++++++++++++%7D%0A%0A++++++++++++++++else%0A%0A++++++++++++++++%7B%0A%0A++++++++++++++++++++ele.style.display+%3D+%22block%22%3B%0A%0A++++++++++++++++%7D%0A%0A++++++++++++%7D%0A%0A++++++++%3C%2Fscript%3E%0A%0A++++++++'
   77    45        STRLEN                                           ~39     !8
         46        IS_SMALLER                                               50, ~39
         47      > JMPZ                                                     ~40, ->56
   79    48    >   INIT_FCALL                                               'substr'
         49        SEND_VAR                                                 !8
         50        SEND_VAL                                                 0
         51        SEND_VAL                                                 50
         52        DO_ICALL                                         $41     
         53        CONCAT                                           ~42     $41, '+...'
         54        ASSIGN                                                   !8, ~42
         55      > JMP                                                      ->57
   85    56    >   ASSIGN                                                   !8, !8
   89    57    >   STRLEN                                           ~45     !9
         58        IS_SMALLER                                               150, ~45
         59      > JMPZ                                                     ~46, ->68
   91    60    >   INIT_FCALL                                               'substr'
         61        SEND_VAR                                                 !9
         62        SEND_VAL                                                 0
         63        SEND_VAL                                                 150
         64        DO_ICALL                                         $47     
         65        CONCAT                                           ~48     $47, '+...'
         66        ASSIGN                                                   !9, ~48
         67      > JMP                                                      ->69
   97    68    >   ASSIGN                                                   !9, !9
  101    69    >   BEGIN_SILENCE                                    ~51     
         70        CONCAT                                           ~53     'setopened_', !4
         71        CONCAT                                           ~54     ~53, ''
         72        FETCH_R                      global              ~52     '_POST'
         73        FETCH_DIM_R                                      ~55     ~52, ~54
         74        END_SILENCE                                              ~51
         75      > JMPZ                                                     ~55, ->87
  105    76    >   INIT_METHOD_CALL                                         !1, 'prepare'
         77        SEND_VAL_EX                                              'UPDATE+pvt_messages+SET+opened%3D%27yes%27+WHERE+id%3D%3Aid'
         78        DO_FCALL                                      0  $56     
         79        ASSIGN                                                   !13, $56
  107    80        INIT_METHOD_CALL                                         !13, 'bindValue'
         81        SEND_VAL_EX                                              '%3Aid'
         82        SEND_VAR_EX                                              !4
         83        SEND_VAL_EX                                              2
         84        DO_FCALL                                      0          
  109    85        INIT_METHOD_CALL                                         !13, 'execute'
         86        DO_FCALL                                      0          
  113    87    >   ROPE_INIT                                    17  ~61     '%0A%0A++++++%3Cform+method%3D%27POST%27+action%3D%27my_messages.php%27+name%3D%27'
  115    88        ROPE_ADD                                      1  ~61     ~61, !8
         89        ROPE_ADD                                      2  ~61     ~61, '%27%3E%0A%0A++++++%3Cb%3E%3Ca+href%3D%27'
  117    90        ROPE_ADD                                      3  ~61     ~61, !6
         91        ROPE_ADD                                      4  ~61     ~61, '%27%3E'
         92        ROPE_ADD                                      5  ~61     ~61, !6
         93        ROPE_ADD                                      6  ~61     ~61, '%3C%2Fa%3E%3C%2Fb%3E%0A%0A++++++%3Cinput+type%3D%27button%27+name%3D%27openmsg%27+value%3D%27'
  119    94        ROPE_ADD                                      7  ~61     ~61, !8
         95        ROPE_ADD                                      8  ~61     ~61, '%27+onClick%3D%27javascript%3Atoggle'
         96        ROPE_ADD                                      9  ~61     ~61, !4
         97        ROPE_ADD                                     10  ~61     ~61, '%28%29%27%3E%0A%0A++++++%3Cinput+type%3D%27submit%27+name%3D%27setopened_'
  121    98        ROPE_ADD                                     11  ~61     ~61, !4
         99        ROPE_ADD                                     12  ~61     ~61, '%27+value%3D%22I%27ve+Read+This%22%3E%0A%0A++++++%3C%2Fform%3E%0A%0A++++++%3Cdiv+id%3D%27toggleText'
  125   100        ROPE_ADD                                     13  ~61     ~61, !4
        101        ROPE_ADD                                     14  ~61     ~61, '%27+style%3D%27display%3A+none%3B%27%3E%0A%0A++++++%3Cbr+%2F%3E'
  127   102        ROPE_ADD                                     15  ~61     ~61, !9
        103        ROPE_END                                     16  ~60     ~61, '%0A%0A++++++%3C%2Fdiv%3E%0A%0A++++++%3Chr+%2F%3E%3Cbr+%2F%3E%0A%0A++++++'
        104        ECHO                                                     ~60
   29   105    >   INIT_METHOD_CALL                                         !0, 'fetch'
        106        SEND_VAL_EX                                              2
        107        DO_FCALL                                      0  $70     
        108        ASSIGN                                           ~71     !5, $70
        109      > JMPNZ                                                    ~71, ->20
        110    > > JMP                                                      ->112
  143   111    >   ECHO                                                     'You+haven%27t+read+any+messages+yet.'
  147   112    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.09 ms | 1408 KiB | 15 Q