3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once('config.php'); if(!$_GET['id']){ $pagetitle = 'Blogs - '.$sitename; $qb = mysql_query("SELECT * FROM blogs") or die(mysql_error()); $qn = mysql_num_rows($qb); require_once('header.php'); echo "<h1>Blogs</h1>"; echo '<ul>'; while($post=mysql_fetch_array($qb)){ echo '<a style="margin-top:20px;display:block;margin-left:20px;" href="blog.php?id='.$post['id'].'">'.$post['title'].'</a>'; } echo '</ul>'; } else { $id = mysql_real_escape_string($_GET['id']); $qb = mysql_query("SELECT * FROM blogs WHERE id='$id'") or die(mysql_error()); $post = mysql_fetch_array($qb); $exist = mysql_num_rows($qb); if($exist=='1'){ $pagetitle = $post['title'].' - '.$sitename; require_once('header.php'); echo '<h1>'.$post['title'].'</h1>'; echo '<p class="para">'.nl2br($post['content']).'</p>'; $qrm = mysql_query("SELECT * FROM blogs WHERE id<>'$id'") or die(mysql_error()); $qnrm = mysql_num_rows($qrm); if($qnrm=='0'){ echo '<!-- no articles to read -->'; } else { echo "<h2 class=h2>You may also Read:</h2>"; echo '<ul>'; while($post=mysql_fetch_array($qrm)){ echo '<a style="margin-top:20px;display:block;margin-left:20px;" href="blog.php?id='.$post['id'].'">'.$post['title'].'</a>'; } echo '</ul>'; } } else { header("Location: index.php?msg=Blog article not found"); } } require_once('sidebar.php'); require_once('footer.php'); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 38
Branch analysis from position: 5
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 24
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 24
Branch analysis from position: 36
Branch analysis from position: 24
Branch analysis from position: 38
2 jumps found. (Code = 47) Position 1 = 53, Position 2 = 57
Branch analysis from position: 53
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 120
Branch analysis from position: 67
2 jumps found. (Code = 47) Position 1 = 91, Position 2 = 95
Branch analysis from position: 91
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 95
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 103
Branch analysis from position: 101
1 jumps found. (Code = 42) Position 1 = 119
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 113
Branch analysis from position: 113
2 jumps found. (Code = 44) Position 1 = 118, Position 2 = 106
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
Branch analysis from position: 106
2 jumps found. (Code = 44) Position 1 = 118, Position 2 = 106
Branch analysis from position: 118
Branch analysis from position: 106
Branch analysis from position: 120
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W2a4B
function name:  (null)
number of ops:  126
compiled vars:  !0 = $pagetitle, !1 = $sitename, !2 = $qb, !3 = $qn, !4 = $post, !5 = $id, !6 = $exist, !7 = $qrm, !8 = $qnrm
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INCLUDE_OR_EVAL                                          'config.php', REQUIRE_ONCE
    8     1        FETCH_R                      global              ~10     '_GET'
          2        FETCH_DIM_R                                      ~11     ~10, 'id'
          3        BOOL_NOT                                         ~12     ~11
          4      > JMPZ                                                     ~12, ->38
    9     5    >   CONCAT                                           ~13     'Blogs+-+', !1
          6        ASSIGN                                                   !0, ~13
   10     7        INIT_FCALL_BY_NAME                                       'mysql_query'
          8        SEND_VAL_EX                                              'SELECT+%2A+FROM+blogs'
          9        DO_FCALL                                      0  $15     
         10        ASSIGN                                           ~16     !2, $15
         11      > JMPNZ_EX                                         ~16     ~16, ->16
         12    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         13        DO_FCALL                                      0  $17     
         14      > EXIT                                                     $17
         15*       BOOL                                             ~16     <true>
   11    16    >   INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $18     
         19        ASSIGN                                                   !3, $18
   12    20        INCLUDE_OR_EVAL                                          'header.php', REQUIRE_ONCE
   13    21        ECHO                                                     '%3Ch1%3EBlogs%3C%2Fh1%3E'
   14    22        ECHO                                                     '%3Cul%3E'
   15    23      > JMP                                                      ->31
   16    24    >   FETCH_DIM_R                                      ~21     !4, 'id'
         25        CONCAT                                           ~22     '%3Ca+style%3D%22margin-top%3A20px%3Bdisplay%3Ablock%3Bmargin-left%3A20px%3B%22+href%3D%22blog.php%3Fid%3D', ~21
         26        CONCAT                                           ~23     ~22, '%22%3E'
         27        FETCH_DIM_R                                      ~24     !4, 'title'
         28        CONCAT                                           ~25     ~23, ~24
         29        CONCAT                                           ~26     ~25, '%3C%2Fa%3E'
         30        ECHO                                                     ~26
   15    31    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         32        SEND_VAR_EX                                              !2
         33        DO_FCALL                                      0  $27     
         34        ASSIGN                                           ~28     !4, $27
         35      > JMPNZ                                                    ~28, ->24
   18    36    >   ECHO                                                     '%3C%2Ful%3E'
         37      > JMP                                                      ->123
   20    38    >   INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         39        CHECK_FUNC_ARG                                           
         40        FETCH_FUNC_ARG               global              $29     '_GET'
         41        FETCH_DIM_FUNC_ARG                               $30     $29, 'id'
         42        SEND_FUNC_ARG                                            $30
         43        DO_FCALL                                      0  $31     
         44        ASSIGN                                                   !5, $31
   21    45        INIT_FCALL_BY_NAME                                       'mysql_query'
         46        ROPE_INIT                                     3  ~34     'SELECT+%2A+FROM+blogs+WHERE+id%3D%27'
         47        ROPE_ADD                                      1  ~34     ~34, !5
         48        ROPE_END                                      2  ~33     ~34, '%27'
         49        SEND_VAL_EX                                              ~33
         50        DO_FCALL                                      0  $36     
         51        ASSIGN                                           ~37     !2, $36
         52      > JMPNZ_EX                                         ~37     ~37, ->57
         53    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         54        DO_FCALL                                      0  $38     
         55      > EXIT                                                     $38
         56*       BOOL                                             ~37     <true>
   22    57    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         58        SEND_VAR_EX                                              !2
         59        DO_FCALL                                      0  $39     
         60        ASSIGN                                                   !4, $39
   23    61        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         62        SEND_VAR_EX                                              !2
         63        DO_FCALL                                      0  $41     
         64        ASSIGN                                                   !6, $41
   24    65        IS_EQUAL                                                 !6, '1'
         66      > JMPZ                                                     ~43, ->120
   25    67    >   FETCH_DIM_R                                      ~44     !4, 'title'
         68        CONCAT                                           ~45     ~44, '+-+'
         69        CONCAT                                           ~46     ~45, !1
         70        ASSIGN                                                   !0, ~46
   26    71        INCLUDE_OR_EVAL                                          'header.php', REQUIRE_ONCE
   27    72        FETCH_DIM_R                                      ~49     !4, 'title'
         73        CONCAT                                           ~50     '%3Ch1%3E', ~49
         74        CONCAT                                           ~51     ~50, '%3C%2Fh1%3E'
         75        ECHO                                                     ~51
   28    76        INIT_FCALL                                               'nl2br'
         77        FETCH_DIM_R                                      ~52     !4, 'content'
         78        SEND_VAL                                                 ~52
         79        DO_ICALL                                         $53     
         80        CONCAT                                           ~54     '%3Cp+class%3D%22para%22%3E', $53
         81        CONCAT                                           ~55     ~54, '%3C%2Fp%3E'
         82        ECHO                                                     ~55
   29    83        INIT_FCALL_BY_NAME                                       'mysql_query'
         84        ROPE_INIT                                     3  ~57     'SELECT+%2A+FROM+blogs+WHERE+id%3C%3E%27'
         85        ROPE_ADD                                      1  ~57     ~57, !5
         86        ROPE_END                                      2  ~56     ~57, '%27'
         87        SEND_VAL_EX                                              ~56
         88        DO_FCALL                                      0  $59     
         89        ASSIGN                                           ~60     !7, $59
         90      > JMPNZ_EX                                         ~60     ~60, ->95
         91    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         92        DO_FCALL                                      0  $61     
         93      > EXIT                                                     $61
         94*       BOOL                                             ~60     <true>
   30    95    >   INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         96        SEND_VAR_EX                                              !7
         97        DO_FCALL                                      0  $62     
         98        ASSIGN                                                   !8, $62
   31    99        IS_EQUAL                                                 !8, '0'
        100      > JMPZ                                                     ~64, ->103
   32   101    >   ECHO                                                     '%3C%21--+no+articles+to+read+--%3E'
        102      > JMP                                                      ->119
   34   103    >   ECHO                                                     '%3Ch2+class%3Dh2%3EYou+may+also+Read%3A%3C%2Fh2%3E'
   35   104        ECHO                                                     '%3Cul%3E'
   36   105      > JMP                                                      ->113
   37   106    >   FETCH_DIM_R                                      ~65     !4, 'id'
        107        CONCAT                                           ~66     '%3Ca+style%3D%22margin-top%3A20px%3Bdisplay%3Ablock%3Bmargin-left%3A20px%3B%22+href%3D%22blog.php%3Fid%3D', ~65
        108        CONCAT                                           ~67     ~66, '%22%3E'
        109        FETCH_DIM_R                                      ~68     !4, 'title'
        110        CONCAT                                           ~69     ~67, ~68
        111        CONCAT                                           ~70     ~69, '%3C%2Fa%3E'
        112        ECHO                                                     ~70
   36   113    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        114        SEND_VAR_EX                                              !7
        115        DO_FCALL                                      0  $71     
        116        ASSIGN                                           ~72     !4, $71
        117      > JMPNZ                                                    ~72, ->106
   39   118    >   ECHO                                                     '%3C%2Ful%3E'
        119    > > JMP                                                      ->123
   42   120    >   INIT_FCALL                                               'header'
        121        SEND_VAL                                                 'Location%3A+index.php%3Fmsg%3DBlog+article+not+found'
        122        DO_ICALL                                                 
   47   123    >   INCLUDE_OR_EVAL                                          'sidebar.php', REQUIRE_ONCE
   48   124        INCLUDE_OR_EVAL                                          'footer.php', REQUIRE_ONCE
   49   125      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.92 ms | 1408 KiB | 17 Q