3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Set your own configuration options as you see fit. $feed = 'http://rss.nytimes.com/services/xml/rss/nyt/InternationalHome.xml'; $success = $feed->init(); // Make sure the page is being served with the right headers. $feed->handle_content_type(); // Set our paging values $start = (isset($_GET['start']) && !empty($_GET['start'])) ? $_GET['start'] : 0; // Where do we start? $length = (isset($_GET['length']) && !empty($_GET['length'])) ? $_GET['length'] : 5; // How many per page? $max = $feed->get_item_quantity(); // Where do we end? // When we end our PHP block, we want to make sure our DOCTYPE is on the top line to make // sure that the browser snaps into Standards Mode. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> <title>SimplePie: Demo</title> <link rel="stylesheet" href="styles.css" type="text/css" media="screen, projector" /> </head> <body> <div id="site"> <?php // If we have an error, display it. if ($feed->error()) { echo '<div class="sp_errors">' . "\r\n"; echo '<p>' . htmlspecialchars($feed->error()) . "</p>\r\n"; echo '</div>' . "\r\n"; } ?> <?php if ($success): ?> <?php // get_items() will accept values from above. foreach($feed->get_items($start, $length) as $item): $feed = $item->get_feed(); ?> <div class="chunk"> <h4><?php if ($item->get_permalink()) echo '<a href="' . $item->get_permalink() . '">'; echo $item->get_title(true); if ($item->get_permalink()) echo '</a>'; ?></h4> <?php echo $item->get_content(); ?> <p class="footnote">Source: <a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a> | <?php echo $item->get_date('j M Y, g:i a'); ?></p> </div> <?php endforeach; ?> <?php endif; ?> <?php // Let's do our paging controls $next = (int) $start + (int) $length; $prev = (int) $start - (int) $length; // Create the NEXT link $nextlink = '<a href="?start=' . $next . '&length=' . $length . '">Next &raquo;</a>'; if ($next > $max) { $nextlink = 'Next &raquo;'; } // Create the PREVIOUS link $prevlink = '<a href="?start=' . $prev . '&length=' . $length . '">&laquo; Previous</a>'; if ($prev < 0 && (int) $start > 0) { $prevlink = '<a href="?start=0&length=' . $length . '">&laquo; Previous</a>'; } else if ($prev < 0) { $prevlink = '&laquo; Previous'; } // Normalize the numbering for humans $begin = (int) $start + 1; $end = ($next > $max) ? $max : $next; ?> <p>Showing <?php echo $begin; ?>&ndash;<?php echo $end; ?> out of <?php echo $max; ?> | <?php echo $prevlink; ?> | <?php echo $nextlink; ?> | <a href="<?php echo '?start=' . $start . '&length=5'; ?>">5</a>, <a href="<?php echo '?start=' . $start . '&length=10'; ?>">10</a>, or <a href="<?php echo '?start=' . $start . '&length=20'; ?>">20</a> at a time.</p> </div> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 51
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 101
Branch analysis from position: 53
2 jumps found. (Code = 77) Position 1 = 59, Position 2 = 99
Branch analysis from position: 59
2 jumps found. (Code = 78) Position 1 = 60, Position 2 = 99
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 72
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 80
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 80
Branch analysis from position: 72
Branch analysis from position: 99
2 jumps found. (Code = 43) Position 1 = 117, Position 2 = 118
Branch analysis from position: 117
2 jumps found. (Code = 46) Position 1 = 125, Position 2 = 128
Branch analysis from position: 125
2 jumps found. (Code = 43) Position 1 = 129, Position 2 = 133
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 136
Branch analysis from position: 136
2 jumps found. (Code = 43) Position 1 = 141, Position 2 = 143
Branch analysis from position: 141
1 jumps found. (Code = 42) Position 1 = 144
Branch analysis from position: 144
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 143
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 133
2 jumps found. (Code = 43) Position 1 = 135, Position 2 = 136
Branch analysis from position: 135
2 jumps found. (Code = 43) Position 1 = 141, Position 2 = 143
Branch analysis from position: 141
Branch analysis from position: 143
Branch analysis from position: 136
Branch analysis from position: 128
Branch analysis from position: 118
Branch analysis from position: 99
Branch analysis from position: 101
Branch analysis from position: 51
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 51
Branch analysis from position: 41
Branch analysis from position: 51
Branch analysis from position: 27
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
Branch analysis from position: 27
Branch analysis from position: 13
filename:       /in/eXDAX
function name:  (null)
number of ops:  169
compiled vars:  !0 = $feed, !1 = $success, !2 = $start, !3 = $length, !4 = $max, !5 = $item, !6 = $next, !7 = $prev, !8 = $nextlink, !9 = $prevlink, !10 = $begin, !11 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Frss.nytimes.com%2Fservices%2Fxml%2Frss%2Fnyt%2FInternationalHome.xml'
    5     1        INIT_METHOD_CALL                                         !0, 'init'
          2        DO_FCALL                                      0  $13     
          3        ASSIGN                                                   !1, $13
    8     4        INIT_METHOD_CALL                                         !0, 'handle_content_type'
          5        DO_FCALL                                      0          
   11     6        FETCH_IS                                         ~16     '_GET'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~17     ~16, 'start'
          8      > JMPZ_EX                                          ~17     ~17, ->13
          9    >   FETCH_IS                                         ~18     '_GET'
         10        ISSET_ISEMPTY_DIM_OBJ                         1  ~19     ~18, 'start'
         11        BOOL_NOT                                         ~20     ~19
         12        BOOL                                             ~17     ~20
         13    > > JMPZ                                                     ~17, ->18
         14    >   FETCH_R                      global              ~21     '_GET'
         15        FETCH_DIM_R                                      ~22     ~21, 'start'
         16        QM_ASSIGN                                        ~23     ~22
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~23     0
         19    >   ASSIGN                                                   !2, ~23
   12    20        FETCH_IS                                         ~25     '_GET'
         21        ISSET_ISEMPTY_DIM_OBJ                         0  ~26     ~25, 'length'
         22      > JMPZ_EX                                          ~26     ~26, ->27
         23    >   FETCH_IS                                         ~27     '_GET'
         24        ISSET_ISEMPTY_DIM_OBJ                         1  ~28     ~27, 'length'
         25        BOOL_NOT                                         ~29     ~28
         26        BOOL                                             ~26     ~29
         27    > > JMPZ                                                     ~26, ->32
         28    >   FETCH_R                      global              ~30     '_GET'
         29        FETCH_DIM_R                                      ~31     ~30, 'length'
         30        QM_ASSIGN                                        ~32     ~31
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~32     5
         33    >   ASSIGN                                                   !3, ~32
   13    34        INIT_METHOD_CALL                                         !0, 'get_item_quantity'
         35        DO_FCALL                                      0  $34     
         36        ASSIGN                                                   !4, $34
   17    37        ECHO                                                     '%3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Transitional%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-transitional.dtd%22%3E%0A+%0A%3Chtml+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22+xml%3Alang%3D%22en-US%22+lang%3D%22en-US%22%3E%0A%3Chead%3E%0A%3Ctitle%3ESimplePie%3A+Demo%3C%2Ftitle%3E%0A+%0A%3Clink+rel%3D%22stylesheet%22+href%3D%22styles.css%22+type%3D%22text%2Fcss%22+media%3D%22screen%2C+projector%22+%2F%3E%0A+%0A%3C%2Fhead%3E%0A+%0A%3Cbody%3E%0A%3Cdiv+id%3D%22site%22%3E%0A%09'
   31    38        INIT_METHOD_CALL                                         !0, 'error'
         39        DO_FCALL                                      0  $36     
         40      > JMPZ                                                     $36, ->51
   33    41    >   ECHO                                                     '%3Cdiv+class%3D%22sp_errors%22%3E%0D%0A'
   34    42        INIT_FCALL                                               'htmlspecialchars'
         43        INIT_METHOD_CALL                                         !0, 'error'
         44        DO_FCALL                                      0  $37     
         45        SEND_VAR                                                 $37
         46        DO_ICALL                                         $38     
         47        CONCAT                                           ~39     '%3Cp%3E', $38
         48        CONCAT                                           ~40     ~39, '%3C%2Fp%3E%0D%0A'
         49        ECHO                                                     ~40
   35    50        ECHO                                                     '%3C%2Fdiv%3E%0D%0A'
   38    51    >   ECHO                                                     '+%0A%09'
   39    52      > JMPZ                                                     !1, ->101
   40    53    >   ECHO                                                     '%09%09'
   42    54        INIT_METHOD_CALL                                         !0, 'get_items'
         55        SEND_VAR_EX                                              !2
         56        SEND_VAR_EX                                              !3
         57        DO_FCALL                                      0  $41     
         58      > FE_RESET_R                                       $42     $41, ->99
         59    > > FE_FETCH_R                                               $42, !5, ->99
   43    60    >   INIT_METHOD_CALL                                         !5, 'get_feed'
         61        DO_FCALL                                      0  $43     
         62        ASSIGN                                                   !0, $43
   45    63        ECHO                                                     '+%0A%09%09%09%3Cdiv+class%3D%22chunk%22%3E%0A+%0A%09%09%09%09%3Ch4%3E'
   48    64        INIT_METHOD_CALL                                         !5, 'get_permalink'
         65        DO_FCALL                                      0  $45     
         66      > JMPZ                                                     $45, ->72
         67    >   INIT_METHOD_CALL                                         !5, 'get_permalink'
         68        DO_FCALL                                      0  $46     
         69        CONCAT                                           ~47     '%3Ca+href%3D%22', $46
         70        CONCAT                                           ~48     ~47, '%22%3E'
         71        ECHO                                                     ~48
         72    >   INIT_METHOD_CALL                                         !5, 'get_title'
         73        SEND_VAL_EX                                              <true>
         74        DO_FCALL                                      0  $49     
         75        ECHO                                                     $49
         76        INIT_METHOD_CALL                                         !5, 'get_permalink'
         77        DO_FCALL                                      0  $50     
         78      > JMPZ                                                     $50, ->80
         79    >   ECHO                                                     '%3C%2Fa%3E'
         80    >   ECHO                                                     '%3C%2Fh4%3E%0A%09%09%09%09'
   49    81        INIT_METHOD_CALL                                         !5, 'get_content'
         82        DO_FCALL                                      0  $51     
         83        ECHO                                                     $51
   50    84        ECHO                                                     '%09%09%09%09%3Cp+class%3D%22footnote%22%3ESource%3A+%3Ca+href%3D%22'
         85        INIT_METHOD_CALL                                         !0, 'get_permalink'
         86        DO_FCALL                                      0  $52     
         87        ECHO                                                     $52
         88        ECHO                                                     '%22%3E'
         89        INIT_METHOD_CALL                                         !0, 'get_title'
         90        DO_FCALL                                      0  $53     
         91        ECHO                                                     $53
         92        ECHO                                                     '%3C%2Fa%3E+%7C+'
         93        INIT_METHOD_CALL                                         !5, 'get_date'
         94        SEND_VAL_EX                                              'j+M+Y%2C+g%3Ai+a'
         95        DO_FCALL                                      0  $54     
         96        ECHO                                                     $54
         97        ECHO                                                     '%3C%2Fp%3E%0A+%0A%09%09%09%3C%2Fdiv%3E%0A+%0A%09%09'
   42    98      > JMP                                                      ->59
         99    >   FE_FREE                                                  $42
   55   100        ECHO                                                     '%09'
   56   101    >   ECHO                                                     '+%0A%09'
   59   102        CAST                                          4  ~55     !2
        103        CAST                                          4  ~56     !3
        104        ADD                                              ~57     ~55, ~56
        105        ASSIGN                                                   !6, ~57
   60   106        CAST                                          4  ~59     !2
        107        CAST                                          4  ~60     !3
        108        SUB                                              ~61     ~59, ~60
        109        ASSIGN                                                   !7, ~61
   63   110        CONCAT                                           ~63     '%3Ca+href%3D%22%3Fstart%3D', !6
        111        CONCAT                                           ~64     ~63, '%26length%3D'
        112        CONCAT                                           ~65     ~64, !3
        113        CONCAT                                           ~66     ~65, '%22%3ENext+%26raquo%3B%3C%2Fa%3E'
        114        ASSIGN                                                   !8, ~66
   64   115        IS_SMALLER                                               !4, !6
        116      > JMPZ                                                     ~68, ->118
   66   117    >   ASSIGN                                                   !8, 'Next+%26raquo%3B'
   70   118    >   CONCAT                                           ~70     '%3Ca+href%3D%22%3Fstart%3D', !7
        119        CONCAT                                           ~71     ~70, '%26length%3D'
        120        CONCAT                                           ~72     ~71, !3
        121        CONCAT                                           ~73     ~72, '%22%3E%26laquo%3B+Previous%3C%2Fa%3E'
        122        ASSIGN                                                   !9, ~73
   71   123        IS_SMALLER                                       ~75     !7, 0
        124      > JMPZ_EX                                          ~75     ~75, ->128
        125    >   CAST                                          4  ~76     !2
        126        IS_SMALLER                                       ~77     0, ~76
        127        BOOL                                             ~75     ~77
        128    > > JMPZ                                                     ~75, ->133
   73   129    >   CONCAT                                           ~78     '%3Ca+href%3D%22%3Fstart%3D0%26length%3D', !3
        130        CONCAT                                           ~79     ~78, '%22%3E%26laquo%3B+Previous%3C%2Fa%3E'
        131        ASSIGN                                                   !9, ~79
        132      > JMP                                                      ->136
   75   133    >   IS_SMALLER                                               !7, 0
        134      > JMPZ                                                     ~81, ->136
   77   135    >   ASSIGN                                                   !9, '%26laquo%3B+Previous'
   81   136    >   CAST                                          4  ~83     !2
        137        ADD                                              ~84     ~83, 1
        138        ASSIGN                                                   !10, ~84
   82   139        IS_SMALLER                                               !4, !6
        140      > JMPZ                                                     ~86, ->143
        141    >   QM_ASSIGN                                        ~87     !4
        142      > JMP                                                      ->144
        143    >   QM_ASSIGN                                        ~87     !6
        144    >   ASSIGN                                                   !11, ~87
   84   145        ECHO                                                     '+%0A%09%3Cp%3EShowing+'
   85   146        ECHO                                                     !10
        147        ECHO                                                     '%26ndash%3B'
        148        ECHO                                                     !11
        149        ECHO                                                     '+out+of+'
        150        ECHO                                                     !4
        151        ECHO                                                     '+%7C+'
        152        ECHO                                                     !9
        153        ECHO                                                     '+%7C+'
        154        ECHO                                                     !8
        155        ECHO                                                     '+%7C+%3Ca+href%3D%22'
        156        CONCAT                                           ~89     '%3Fstart%3D', !2
        157        CONCAT                                           ~90     ~89, '%26length%3D5'
        158        ECHO                                                     ~90
        159        ECHO                                                     '%22%3E5%3C%2Fa%3E%2C+%3Ca+href%3D%22'
        160        CONCAT                                           ~91     '%3Fstart%3D', !2
        161        CONCAT                                           ~92     ~91, '%26length%3D10'
        162        ECHO                                                     ~92
        163        ECHO                                                     '%22%3E10%3C%2Fa%3E%2C+or+%3Ca+href%3D%22'
        164        CONCAT                                           ~93     '%3Fstart%3D', !2
        165        CONCAT                                           ~94     ~93, '%26length%3D20'
        166        ECHO                                                     ~94
        167        ECHO                                                     '%22%3E20%3C%2Fa%3E+at+a+time.%3C%2Fp%3E%0A%3C%2Fdiv%3E%0A+%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   89   168      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.89 ms | 1412 KiB | 15 Q