3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 'On'); error_reporting(E_ALL); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; define("DB_HOST","mysql117.loopia.se"); define("DB_USER","normal@i103189"); define("DB_PASS","KungMicke87"); define("DB_NAME","indiehjaerta_com"); if (isset($_POST['add'])) { //forumreplies if (isset($_POST['forumid']) && (!empty($_POST['forumid']))) { // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli)); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $saveThread = TRUE; $emptyStory = FALSE; $emptyText = FALSE; $subject = mysqli_real_escape_string($sqli, $_POST['subject']); $text = mysqli_real_escape_string($sqli, $_POST['text']); $fid = mysqli_real_escape_string($sqli, $_POST['forumid']); $query = mysqli_query($sqli,"SELECT * FROM forumcat WHERE id='$fid'") or die("Error: ".mysqli_error($sqli)); $results = mysqli_num_rows($query); if ($results == 0) { $error = "No such CategoryID."; } else { $timestamp = date('Y-m-d H:i:s'); $userid = $_SESSION['id']; if (empty($subject)) { $emptySubject = TRUE; $saveThread = FALSE; } elseif (empty($text)) { $emptyText = TRUE; $saveThread = FALSE; } if ($saveThread == TRUE) { $addquery = mysqli_query($sqli,"INSERT INTO forumtopics (`threadname`, `text`, `categoryid`, `userid`, `timestamp`) VALUES ('$subject', '$text', '$fid', '$userid', '$timestamp')"); $tid = mysqli_insert_id($addquery); header("location:forummessage.php?added=thread&fid=$fid&tid=$tid"); } } } else { echo "No ForumID set."; } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="logout.php">Logout<a/> <br /> <hr /> <br /> <?php $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); echo '<span class="text">Page generated in '.$total_time.' seconds.</span><br />'; ?> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 169
Branch analysis from position: 39
2 jumps found. (Code = 46) Position 1 = 42, Position 2 = 46
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 168
Branch analysis from position: 47
2 jumps found. (Code = 47) Position 1 = 59, Position 2 = 65
Branch analysis from position: 59
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 72
Branch analysis from position: 68
2 jumps found. (Code = 47) Position 1 = 108, Position 2 = 114
Branch analysis from position: 108
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 114
2 jumps found. (Code = 43) Position 1 = 120, Position 2 = 122
Branch analysis from position: 120
1 jumps found. (Code = 42) Position 1 = 167
Branch analysis from position: 167
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 122
2 jumps found. (Code = 43) Position 1 = 131, Position 2 = 134
Branch analysis from position: 131
1 jumps found. (Code = 42) Position 1 = 138
Branch analysis from position: 138
2 jumps found. (Code = 43) Position 1 = 140, Position 2 = 167
Branch analysis from position: 140
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
Branch analysis from position: 167
Branch analysis from position: 134
2 jumps found. (Code = 43) Position 1 = 136, Position 2 = 138
Branch analysis from position: 136
2 jumps found. (Code = 43) Position 1 = 140, Position 2 = 167
Branch analysis from position: 140
Branch analysis from position: 167
Branch analysis from position: 138
Branch analysis from position: 72
Branch analysis from position: 168
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 169
filename:       /in/ssWRF
function name:  (null)
number of ops:  194
compiled vars:  !0 = $time, !1 = $start, !2 = $sqli, !3 = $saveThread, !4 = $emptyStory, !5 = $emptyText, !6 = $subject, !7 = $text, !8 = $fid, !9 = $query, !10 = $results, !11 = $error, !12 = $timestamp, !13 = $userid, !14 = $emptySubject, !15 = $addquery, !16 = $tid, !17 = $finish, !18 = $total_time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'display_errors'
          2        SEND_VAL                                                 'On'
          3        DO_ICALL                                                 
    3     4        INIT_FCALL                                               'error_reporting'
          5        SEND_VAL                                                 32767
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'microtime'
          8        DO_ICALL                                         $21     
          9        ASSIGN                                                   !0, $21
    6    10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '+'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $23     
         14        ASSIGN                                                   !0, $23
    7    15        FETCH_DIM_R                                      ~25     !0, 1
         16        FETCH_DIM_R                                      ~26     !0, 0
         17        ADD                                              ~27     ~25, ~26
         18        ASSIGN                                                   !0, ~27
    8    19        ASSIGN                                                   !1, !0
   10    20        INIT_FCALL                                               'define'
         21        SEND_VAL                                                 'DB_HOST'
         22        SEND_VAL                                                 'mysql117.loopia.se'
         23        DO_ICALL                                                 
   11    24        INIT_FCALL                                               'define'
         25        SEND_VAL                                                 'DB_USER'
         26        SEND_VAL                                                 'normal%40i103189'
         27        DO_ICALL                                                 
   12    28        INIT_FCALL                                               'define'
         29        SEND_VAL                                                 'DB_PASS'
         30        SEND_VAL                                                 'KungMicke87'
         31        DO_ICALL                                                 
   13    32        INIT_FCALL                                               'define'
         33        SEND_VAL                                                 'DB_NAME'
         34        SEND_VAL                                                 'indiehjaerta_com'
         35        DO_ICALL                                                 
   15    36        FETCH_IS                                         ~34     '_POST'
         37        ISSET_ISEMPTY_DIM_OBJ                         0          ~34, 'add'
         38      > JMPZ                                                     ~35, ->169
   19    39    >   FETCH_IS                                         ~36     '_POST'
         40        ISSET_ISEMPTY_DIM_OBJ                         0  ~37     ~36, 'forumid'
         41      > JMPZ_EX                                          ~37     ~37, ->46
         42    >   FETCH_IS                                         ~38     '_POST'
         43        ISSET_ISEMPTY_DIM_OBJ                         1  ~39     ~38, 'forumid'
         44        BOOL_NOT                                         ~40     ~39
         45        BOOL                                             ~37     ~40
         46    > > JMPZ                                                     ~37, ->168
   22    47    >   INIT_FCALL_BY_NAME                                       'mysqli_connect'
         48        FETCH_CONSTANT                                   ~41     'DB_HOST'
         49        SEND_VAL_EX                                              ~41
         50        FETCH_CONSTANT                                   ~42     'DB_USER'
         51        SEND_VAL_EX                                              ~42
         52        FETCH_CONSTANT                                   ~43     'DB_PASS'
         53        SEND_VAL_EX                                              ~43
         54        FETCH_CONSTANT                                   ~44     'DB_NAME'
         55        SEND_VAL_EX                                              ~44
         56        DO_FCALL                                      0  $45     
         57        ASSIGN                                           ~46     !2, $45
         58      > JMPNZ_EX                                         ~46     ~46, ->65
         59    >   INIT_FCALL_BY_NAME                                       'mysqli_error'
         60        SEND_VAR_EX                                              !2
         61        DO_FCALL                                      0  $47     
         62        CONCAT                                           ~48     'Error%3A+', $47
         63      > EXIT                                                     ~48
         64*       BOOL                                             ~46     <true>
   25    65    >   INIT_FCALL_BY_NAME                                       'mysqli_connect_errno'
         66        DO_FCALL                                      0  $49     
         67      > JMPZ                                                     $49, ->72
   27    68    >   INIT_FCALL_BY_NAME                                       'mysqli_connect_error'
         69        DO_FCALL                                      0  $50     
         70        CONCAT                                           ~51     'Failed+to+connect+to+MySQL%3A+', $50
         71        ECHO                                                     ~51
   30    72    >   ASSIGN                                                   !3, <true>
   31    73        ASSIGN                                                   !4, <false>
   32    74        ASSIGN                                                   !5, <false>
   34    75        INIT_FCALL_BY_NAME                                       'mysqli_real_escape_string'
         76        SEND_VAR_EX                                              !2
         77        CHECK_FUNC_ARG                                           
         78        FETCH_FUNC_ARG               global              $55     '_POST'
         79        FETCH_DIM_FUNC_ARG                               $56     $55, 'subject'
         80        SEND_FUNC_ARG                                            $56
         81        DO_FCALL                                      0  $57     
         82        ASSIGN                                                   !6, $57
   35    83        INIT_FCALL_BY_NAME                                       'mysqli_real_escape_string'
         84        SEND_VAR_EX                                              !2
         85        CHECK_FUNC_ARG                                           
         86        FETCH_FUNC_ARG               global              $59     '_POST'
         87        FETCH_DIM_FUNC_ARG                               $60     $59, 'text'
         88        SEND_FUNC_ARG                                            $60
         89        DO_FCALL                                      0  $61     
         90        ASSIGN                                                   !7, $61
   36    91        INIT_FCALL_BY_NAME                                       'mysqli_real_escape_string'
         92        SEND_VAR_EX                                              !2
         93        CHECK_FUNC_ARG                                           
         94        FETCH_FUNC_ARG               global              $63     '_POST'
         95        FETCH_DIM_FUNC_ARG                               $64     $63, 'forumid'
         96        SEND_FUNC_ARG                                            $64
         97        DO_FCALL                                      0  $65     
         98        ASSIGN                                                   !8, $65
   38    99        INIT_FCALL_BY_NAME                                       'mysqli_query'
        100        SEND_VAR_EX                                              !2
        101        ROPE_INIT                                     3  ~68     'SELECT+%2A+FROM+forumcat+WHERE+id%3D%27'
        102        ROPE_ADD                                      1  ~68     ~68, !8
        103        ROPE_END                                      2  ~67     ~68, '%27'
        104        SEND_VAL_EX                                              ~67
        105        DO_FCALL                                      0  $70     
        106        ASSIGN                                           ~71     !9, $70
        107      > JMPNZ_EX                                         ~71     ~71, ->114
        108    >   INIT_FCALL_BY_NAME                                       'mysqli_error'
        109        SEND_VAR_EX                                              !2
        110        DO_FCALL                                      0  $72     
        111        CONCAT                                           ~73     'Error%3A+', $72
        112      > EXIT                                                     ~73
        113*       BOOL                                             ~71     <true>
   40   114    >   INIT_FCALL_BY_NAME                                       'mysqli_num_rows'
        115        SEND_VAR_EX                                              !9
        116        DO_FCALL                                      0  $74     
        117        ASSIGN                                                   !10, $74
   42   118        IS_EQUAL                                                 !10, 0
        119      > JMPZ                                                     ~76, ->122
   44   120    >   ASSIGN                                                   !11, 'No+such+CategoryID.'
        121      > JMP                                                      ->167
   48   122    >   INIT_FCALL                                               'date'
        123        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
        124        DO_ICALL                                         $78     
        125        ASSIGN                                                   !12, $78
   49   126        FETCH_R                      global              ~80     '_SESSION'
        127        FETCH_DIM_R                                      ~81     ~80, 'id'
        128        ASSIGN                                                   !13, ~81
   51   129        ISSET_ISEMPTY_CV                                         !6
        130      > JMPZ                                                     ~83, ->134
   53   131    >   ASSIGN                                                   !14, <true>
   54   132        ASSIGN                                                   !3, <false>
        133      > JMP                                                      ->138
   56   134    >   ISSET_ISEMPTY_CV                                         !7
        135      > JMPZ                                                     ~86, ->138
   58   136    >   ASSIGN                                                   !5, <true>
   59   137        ASSIGN                                                   !3, <false>
   62   138    >   BOOL                                             ~89     !3
        139      > JMPZ                                                     ~89, ->167
   64   140    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
        141        SEND_VAR_EX                                              !2
        142        ROPE_INIT                                    11  ~91     'INSERT+INTO+forumtopics+%28%60threadname%60%2C+%60text%60%2C+%60categoryid%60%2C+%60userid%60%2C+%60timestamp%60%29+VALUES+%28%27'
        143        ROPE_ADD                                      1  ~91     ~91, !6
        144        ROPE_ADD                                      2  ~91     ~91, '%27%2C+%27'
        145        ROPE_ADD                                      3  ~91     ~91, !7
        146        ROPE_ADD                                      4  ~91     ~91, '%27%2C+%27'
        147        ROPE_ADD                                      5  ~91     ~91, !8
        148        ROPE_ADD                                      6  ~91     ~91, '%27%2C+%27'
        149        ROPE_ADD                                      7  ~91     ~91, !13
        150        ROPE_ADD                                      8  ~91     ~91, '%27%2C+%27'
        151        ROPE_ADD                                      9  ~91     ~91, !12
        152        ROPE_END                                     10  ~90     ~91, '%27%29'
        153        SEND_VAL_EX                                              ~90
        154        DO_FCALL                                      0  $97     
        155        ASSIGN                                                   !15, $97
   66   156        INIT_FCALL_BY_NAME                                       'mysqli_insert_id'
        157        SEND_VAR_EX                                              !15
        158        DO_FCALL                                      0  $99     
        159        ASSIGN                                                   !16, $99
   68   160        INIT_FCALL                                               'header'
        161        ROPE_INIT                                     4  ~102    'location%3Aforummessage.php%3Fadded%3Dthread%26fid%3D'
        162        ROPE_ADD                                      1  ~102    ~102, !8
        163        ROPE_ADD                                      2  ~102    ~102, '%26tid%3D'
        164        ROPE_END                                      3  ~101    ~102, !16
        165        SEND_VAL                                                 ~101
        166        DO_ICALL                                                 
        167    > > JMP                                                      ->169
   74   168    >   ECHO                                                     'No+ForumID+set.'
   78   169    >   ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%0A%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3Bcharset%3DUTF-8%22+%2F%3E%0A%0A%3Ctitle%3Eindiehjaerta.com+-+Forum%3C%2Ftitle%3E%0A%0A%3Clink+href%3D%22style_test.css%22+rel%3D%22stylesheet%22+type%3D%22text%2Fcss%22+%2F%3E%0A%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%0A%3Ca+href%3D%22login.php%22%3ELogin%3Ca%2F%3E+-+%0A%3Ca+href%3D%22admin.php%22%3EAdmin%3Ca%2F%3E+-+%0A%3Ca+href%3D%22members.php%22%3EMembers%3Ca%2F%3E+-+%0A%3Ca+href%3D%22register.php%22%3ERegister%3Ca%2F%3E+-+%0A%3Ca+href%3D%22blog.php%22%3EBlog%3Ca%2F%3E+-+%0A%3Ca+href%3D%22news.php%22%3ENews%3Ca%2F%3E+-+%0A%3Ca+href%3D%22event.php%22%3EEvent%3Ca%2F%3E+-+%0A%3Ca+href%3D%22forum.php%22%3EForum%3Ca%2F%3E+-+%0A%3Ca+href%3D%22logout.php%22%3ELogout%3Ca%2F%3E%0A%0A%3Cbr+%2F%3E%0A%3Chr+%2F%3E+%0A%3Cbr+%2F%3E%0A%0A%0A%0A'
  107   170        INIT_FCALL                                               'microtime'
        171        DO_ICALL                                         $105    
        172        ASSIGN                                                   !0, $105
  108   173        INIT_FCALL                                               'explode'
        174        SEND_VAL                                                 '+'
        175        SEND_VAR                                                 !0
        176        DO_ICALL                                         $107    
        177        ASSIGN                                                   !0, $107
  109   178        FETCH_DIM_R                                      ~109    !0, 1
        179        FETCH_DIM_R                                      ~110    !0, 0
        180        ADD                                              ~111    ~109, ~110
        181        ASSIGN                                                   !0, ~111
  110   182        ASSIGN                                                   !17, !0
  111   183        INIT_FCALL                                               'round'
        184        SUB                                              ~114    !17, !1
        185        SEND_VAL                                                 ~114
        186        SEND_VAL                                                 4
        187        DO_ICALL                                         $115    
        188        ASSIGN                                                   !18, $115
  112   189        CONCAT                                           ~117    '%3Cspan+class%3D%22text%22%3EPage+generated+in+', !18
        190        CONCAT                                           ~118    ~117, '+seconds.%3C%2Fspan%3E%3Cbr+%2F%3E'
        191        ECHO                                                     ~118
  114   192        ECHO                                                     '%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
  116   193      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.48 ms | 1412 KiB | 29 Q