3v4l.org

run code in 300+ PHP versions simultaneously
<?php //include_once "fbconfig.php"; if($user){ echo "<!-- user logged in -->"; if($_POST) { include_once "limit.php"; if($s['posts'] !== 10) { if(time()>$_SESSION['timelimit']) { if(time()>$_SESSION['postTimeFlag']) { if($_POST['message'] || $_POST['link'] || $_POST['picture']) { $body = array( 'message' => $_POST['message'], 'link' => $_POST['link'], 'picture' => $_POST['picture'], 'name' => $_POST['name'], 'caption' => $_POST['caption'], 'description' => $_POST['description'], ); $batchPost=array(); $i=1; $flag=1; foreach($_POST as $key => $value) { if(strpos($key,"id_") === 0) { $batchPost[] = array('method' => 'POST', 'relative_url' => "/$value/feed", 'body' => http_build_query($body)); if($i++ == 50) { try{ $multiPostResponse = $facebook->api('?batch='.urlencode(json_encode($batchPost)), 'POST'); }catch(FacebookApiException $e){ error_log($e); echo("Batch Post Failed"); } $flag=0; unset($batchPost); $i=1; } } } if(isset($batchPost) && count($batchPost) > 0 ) { try{ $multiPostResponse = $facebook->api('?batch='.urlencode(json_encode($batchPost)), 'POST'); }catch(FacebookApiException $e){ error_log($e); echo("Batch Post Failed"); } $flag=0; } } else { $flag=2; } if(isset($flag) && $flag==1) { echo "<div id=\"response\"><div style='border:2px solid red;width:600px;background:#f99' >Please select atleast one page, group, or friend</div></div>"; $flag=0; } elseif(isset($flag) && $flag==2) { echo "<div id=\"response\"><div style='border:2px solid red;width:600px;background:#f99' >Please enter a message, link, or picture</div></div>"; $flag=0; } elseif(isset($multiPostResponse)) echo "<div id=\"response\"><div style='border:2px solid green;width:600px;background:#cfc' >Your post shared with selected timelines</div></div>"; $_SESSION['postTimeFlag'] = time() + 60; } else { echo "<div id=\"response\"><div style='border:2px solid red;width:600px;background:#f99' >You are going too fast, try that again as you are limited to a single post per minute</div></div>"; } } else { echo "error 2"; } } else { echo "error 3"; } } } else { echo "Not logged in"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 159
Branch analysis from position: 1
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 158
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 157
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 155
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 153
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 47) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 126
Branch analysis from position: 31
2 jumps found. (Code = 77) Position 1 = 55, Position 2 = 99
Branch analysis from position: 55
2 jumps found. (Code = 78) Position 1 = 56, Position 2 = 99
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 98
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 98
Branch analysis from position: 77
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
Branch analysis from position: 98
Branch analysis from position: 98
Branch analysis from position: 99
2 jumps found. (Code = 46) Position 1 = 102, Position 2 = 105
Branch analysis from position: 102
2 jumps found. (Code = 43) Position 1 = 106, Position 2 = 125
Branch analysis from position: 106
1 jumps found. (Code = 42) Position 1 = 124
Branch analysis from position: 124
1 jumps found. (Code = 42) Position 1 = 127
Branch analysis from position: 127
2 jumps found. (Code = 46) Position 1 = 129, Position 2 = 131
Branch analysis from position: 129
2 jumps found. (Code = 43) Position 1 = 132, Position 2 = 135
Branch analysis from position: 132
1 jumps found. (Code = 42) Position 1 = 146
Branch analysis from position: 146
1 jumps found. (Code = 42) Position 1 = 154
Branch analysis from position: 154
1 jumps found. (Code = 42) Position 1 = 156
Branch analysis from position: 156
1 jumps found. (Code = 42) Position 1 = 158
Branch analysis from position: 158
1 jumps found. (Code = 42) Position 1 = 160
Branch analysis from position: 160
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 135
2 jumps found. (Code = 46) Position 1 = 137, Position 2 = 139
Branch analysis from position: 137
2 jumps found. (Code = 43) Position 1 = 140, Position 2 = 143
Branch analysis from position: 140
1 jumps found. (Code = 42) Position 1 = 146
Branch analysis from position: 146
Branch analysis from position: 143
2 jumps found. (Code = 43) Position 1 = 145, Position 2 = 146
Branch analysis from position: 145
1 jumps found. (Code = 42) Position 1 = 154
Branch analysis from position: 154
Branch analysis from position: 146
Branch analysis from position: 139
Branch analysis from position: 131
Branch analysis from position: 125
Branch analysis from position: 105
Branch analysis from position: 99
Branch analysis from position: 126
2 jumps found. (Code = 46) Position 1 = 129, Position 2 = 131
Branch analysis from position: 129
Branch analysis from position: 131
Branch analysis from position: 30
Branch analysis from position: 26
Branch analysis from position: 153
1 jumps found. (Code = 42) Position 1 = 156
Branch analysis from position: 156
Branch analysis from position: 155
1 jumps found. (Code = 42) Position 1 = 158
Branch analysis from position: 158
Branch analysis from position: 157
1 jumps found. (Code = 42) Position 1 = 160
Branch analysis from position: 160
Branch analysis from position: 158
Branch analysis from position: 159
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 90
Branch analysis from position: 90
2 jumps found. (Code = 107) Position 1 = 91, Position 2 = -2
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
Found catch point at position: 119
Branch analysis from position: 119
2 jumps found. (Code = 107) Position 1 = 120, Position 2 = -2
Branch analysis from position: 120
1 jumps found. (Code = 42) Position 1 = 127
Branch analysis from position: 127
filename:       /in/c6fWg
function name:  (null)
number of ops:  161
compiled vars:  !0 = $user, !1 = $s, !2 = $body, !3 = $batchPost, !4 = $i, !5 = $flag, !6 = $value, !7 = $key, !8 = $multiPostResponse, !9 = $facebook, !10 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     !0, ->159
          1    >   ECHO                                                     '%3C%21--+user+logged+in+--%3E'
    4     2        FETCH_R                      global              ~11     '_POST'
          3      > JMPZ                                                     ~11, ->158
    6     4    >   INCLUDE_OR_EVAL                                          'limit.php', INCLUDE_ONCE
    7     5        FETCH_DIM_R                                      ~13     !1, 'posts'
          6        IS_NOT_IDENTICAL                                         ~13, 10
          7      > JMPZ                                                     ~14, ->157
    8     8    >   INIT_FCALL                                               'time'
          9        DO_ICALL                                         $15     
         10        FETCH_R                      global              ~16     '_SESSION'
         11        FETCH_DIM_R                                      ~17     ~16, 'timelimit'
         12        IS_SMALLER                                               ~17, $15
         13      > JMPZ                                                     ~18, ->155
    9    14    >   INIT_FCALL                                               'time'
         15        DO_ICALL                                         $19     
         16        FETCH_R                      global              ~20     '_SESSION'
         17        FETCH_DIM_R                                      ~21     ~20, 'postTimeFlag'
         18        IS_SMALLER                                               ~21, $19
         19      > JMPZ                                                     ~22, ->153
   12    20    >   FETCH_R                      global              ~23     '_POST'
         21        FETCH_DIM_R                                      ~24     ~23, 'message'
         22      > JMPNZ_EX                                         ~24     ~24, ->26
         23    >   FETCH_R                      global              ~25     '_POST'
         24        FETCH_DIM_R                                      ~26     ~25, 'link'
         25        BOOL                                             ~24     ~26
         26    > > JMPNZ_EX                                         ~24     ~24, ->30
         27    >   FETCH_R                      global              ~27     '_POST'
         28        FETCH_DIM_R                                      ~28     ~27, 'picture'
         29        BOOL                                             ~24     ~28
         30    > > JMPZ                                                     ~24, ->126
   16    31    >   FETCH_R                      global              ~29     '_POST'
         32        FETCH_DIM_R                                      ~30     ~29, 'message'
         33        INIT_ARRAY                                       ~31     ~30, 'message'
   18    34        FETCH_R                      global              ~32     '_POST'
         35        FETCH_DIM_R                                      ~33     ~32, 'link'
         36        ADD_ARRAY_ELEMENT                                ~31     ~33, 'link'
   20    37        FETCH_R                      global              ~34     '_POST'
         38        FETCH_DIM_R                                      ~35     ~34, 'picture'
         39        ADD_ARRAY_ELEMENT                                ~31     ~35, 'picture'
   22    40        FETCH_R                      global              ~36     '_POST'
         41        FETCH_DIM_R                                      ~37     ~36, 'name'
         42        ADD_ARRAY_ELEMENT                                ~31     ~37, 'name'
   24    43        FETCH_R                      global              ~38     '_POST'
         44        FETCH_DIM_R                                      ~39     ~38, 'caption'
         45        ADD_ARRAY_ELEMENT                                ~31     ~39, 'caption'
   26    46        FETCH_R                      global              ~40     '_POST'
         47        FETCH_DIM_R                                      ~41     ~40, 'description'
         48        ADD_ARRAY_ELEMENT                                ~31     ~41, 'description'
   14    49        ASSIGN                                                   !2, ~31
   32    50        ASSIGN                                                   !3, <array>
   36    51        ASSIGN                                                   !4, 1
   38    52        ASSIGN                                                   !5, 1
   40    53        FETCH_R                      global              ~46     '_POST'
         54      > FE_RESET_R                                       $47     ~46, ->99
         55    > > FE_FETCH_R                                       ~48     $47, !6, ->99
         56    >   ASSIGN                                                   !7, ~48
   42    57        INIT_FCALL                                               'strpos'
         58        SEND_VAR                                                 !7
         59        SEND_VAL                                                 'id_'
         60        DO_ICALL                                         $50     
         61        IS_IDENTICAL                                             $50, 0
         62      > JMPZ                                                     ~51, ->98
   44    63    >   INIT_ARRAY                                       ~53     'POST', 'method'
         64        ROPE_INIT                                     3  ~55     '%2F'
         65        ROPE_ADD                                      1  ~55     ~55, !6
         66        ROPE_END                                      2  ~54     ~55, '%2Ffeed'
         67        ADD_ARRAY_ELEMENT                                ~53     ~54, 'relative_url'
         68        INIT_FCALL                                               'http_build_query'
         69        SEND_VAR                                                 !2
         70        DO_ICALL                                         $57     
         71        ADD_ARRAY_ELEMENT                                ~53     $57, 'body'
         72        ASSIGN_DIM                                               !3
         73        OP_DATA                                                  ~53
   46    74        POST_INC                                         ~58     !4
         75        IS_EQUAL                                                 ~58, 50
         76      > JMPZ                                                     ~59, ->98
   50    77    >   INIT_METHOD_CALL                                         !9, 'api'
         78        INIT_FCALL                                               'urlencode'
         79        INIT_FCALL                                               'json_encode'
         80        SEND_VAR                                                 !3
         81        DO_ICALL                                         $60     
         82        SEND_VAR                                                 $60
         83        DO_ICALL                                         $61     
         84        CONCAT                                           ~62     '%3Fbatch%3D', $61
         85        SEND_VAL_EX                                              ~62
         86        SEND_VAL_EX                                              'POST'
         87        DO_FCALL                                      0  $63     
         88        ASSIGN                                                   !8, $63
         89      > JMP                                                      ->95
   52    90  E > > CATCH                                       last         'FacebookApiException'
   54    91    >   INIT_FCALL                                               'error_log'
         92        SEND_VAR                                                 !10
         93        DO_ICALL                                                 
   56    94        ECHO                                                     'Batch+Post+Failed'
   60    95    >   ASSIGN                                                   !5, 0
   62    96        UNSET_CV                                                 !3
   64    97        ASSIGN                                                   !4, 1
   40    98    > > JMP                                                      ->55
         99    >   FE_FREE                                                  $47
   72   100        ISSET_ISEMPTY_CV                                 ~68     !3
        101      > JMPZ_EX                                          ~68     ~68, ->105
        102    >   COUNT                                            ~69     !3
        103        IS_SMALLER                                       ~70     0, ~69
        104        BOOL                                             ~68     ~70
        105    > > JMPZ                                                     ~68, ->125
   76   106    >   INIT_METHOD_CALL                                         !9, 'api'
        107        INIT_FCALL                                               'urlencode'
        108        INIT_FCALL                                               'json_encode'
        109        SEND_VAR                                                 !3
        110        DO_ICALL                                         $71     
        111        SEND_VAR                                                 $71
        112        DO_ICALL                                         $72     
        113        CONCAT                                           ~73     '%3Fbatch%3D', $72
        114        SEND_VAL_EX                                              ~73
        115        SEND_VAL_EX                                              'POST'
        116        DO_FCALL                                      0  $74     
        117        ASSIGN                                                   !8, $74
        118      > JMP                                                      ->124
   78   119  E > > CATCH                                       last         'FacebookApiException'
   80   120    >   INIT_FCALL                                               'error_log'
        121        SEND_VAR                                                 !10
        122        DO_ICALL                                                 
   82   123        ECHO                                                     'Batch+Post+Failed'
   86   124    >   ASSIGN                                                   !5, 0
        125    > > JMP                                                      ->127
   96   126    >   ASSIGN                                                   !5, 2
  101   127    >   ISSET_ISEMPTY_CV                                 ~79     !5
        128      > JMPZ_EX                                          ~79     ~79, ->131
        129    >   IS_EQUAL                                         ~80     !5, 1
        130        BOOL                                             ~79     ~80
        131    > > JMPZ                                                     ~79, ->135
        132    >   ECHO                                                     '%3Cdiv+id%3D%22response%22%3E%3Cdiv+style%3D%27border%3A2px+solid+red%3Bwidth%3A600px%3Bbackground%3A%23f99%27+%3EPlease+select+atleast+one+page%2C+group%2C+or+friend%3C%2Fdiv%3E%3C%2Fdiv%3E'
        133        ASSIGN                                                   !5, 0
        134      > JMP                                                      ->146
  102   135    >   ISSET_ISEMPTY_CV                                 ~82     !5
        136      > JMPZ_EX                                          ~82     ~82, ->139
        137    >   IS_EQUAL                                         ~83     !5, 2
        138        BOOL                                             ~82     ~83
        139    > > JMPZ                                                     ~82, ->143
        140    >   ECHO                                                     '%3Cdiv+id%3D%22response%22%3E%3Cdiv+style%3D%27border%3A2px+solid+red%3Bwidth%3A600px%3Bbackground%3A%23f99%27+%3EPlease+enter+a+message%2C+link%2C+or+picture%3C%2Fdiv%3E%3C%2Fdiv%3E'
        141        ASSIGN                                                   !5, 0
        142      > JMP                                                      ->146
  103   143    >   ISSET_ISEMPTY_CV                                         !8
        144      > JMPZ                                                     ~85, ->146
        145    >   ECHO                                                     '%3Cdiv+id%3D%22response%22%3E%3Cdiv+style%3D%27border%3A2px+solid+green%3Bwidth%3A600px%3Bbackground%3A%23cfc%27+%3EYour+post+shared+with+selected+timelines%3C%2Fdiv%3E%3C%2Fdiv%3E'
  104   146    >   INIT_FCALL                                               'time'
        147        DO_ICALL                                         $88     
        148        ADD                                              ~89     $88, 60
        149        FETCH_W                      global              $86     '_SESSION'
        150        ASSIGN_DIM                                               $86, 'postTimeFlag'
        151        OP_DATA                                                  ~89
        152      > JMP                                                      ->154
  106   153    >   ECHO                                                     '%3Cdiv+id%3D%22response%22%3E%3Cdiv+style%3D%27border%3A2px+solid+red%3Bwidth%3A600px%3Bbackground%3A%23f99%27+%3EYou+are+going+too+fast%2C+try+that+again+as+you+are+limited+to+a+single+post+per+minute%3C%2Fdiv%3E%3C%2Fdiv%3E'
        154    > > JMP                                                      ->156
  108   155    >   ECHO                                                     'error+2'
        156    > > JMP                                                      ->158
  109   157    >   ECHO                                                     'error+3'
        158    > > JMP                                                      ->160
  113   159    >   ECHO                                                     'Not+logged+in'
  114   160    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.4 ms | 1412 KiB | 25 Q