3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['submit']) && isset($_POST['rid']) && !empty($_POST['rid'])) { $location = 'http://results.vtu.ac.in/vitavi.php'; $userAgent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'; $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $location ); $post_array = array( "rid" => $_POST['rid'], "submit" => "SUBMIT" ); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array); $response = curl_exec($ch); //change this to whatever... $extract = array("start" =>'<TD width="513">', "end"=>'<b>REGISTRAR(EVALUATION)</b>'); $start = stripos($response, $extract['start']); $end = stripos($response, $extract['end']); $response = substr($response, $start, $end); echo $response."<br/>"; $start = '<TD width="513">'; $end = '<br>'; $response = strstr($response, $start); $end = stripos($response, $end); $response = substr($response, strlen($start), $end - strlen($start)); echo $response."<br/>"; } ?> <html> <form name="new" method="POST"> <p>Enter the University Seat No: <input type="TEXT" name="rid" size="20" maxlength="50"><br><br><br><br> <input type="SUBMIT" name="submit" value="SUBMIT" align="center"><br></p> </form> </html> foreach($xml->xpath('//product[starts-with(name/text(),"Shirt 12")]') as $product) { echo $product->mathamatics; echo "\n"; echo $product->price; echo "\n"; echo $product->color; echo "\n\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 112
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 112
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/vLOeQ
function name:  (null)
number of ops:  114
compiled vars:  !0 = $location, !1 = $userAgent, !2 = $ch, !3 = $post_array, !4 = $response, !5 = $extract, !6 = $start, !7 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_IS                                         ~8      '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         0  ~9      ~8, 'submit'
          2      > JMPZ_EX                                          ~9      ~9, ->6
          3    >   FETCH_IS                                         ~10     '_POST'
          4        ISSET_ISEMPTY_DIM_OBJ                         0  ~11     ~10, 'rid'
          5        BOOL                                             ~9      ~11
          6    > > JMPZ_EX                                          ~9      ~9, ->11
          7    >   FETCH_IS                                         ~12     '_POST'
          8        ISSET_ISEMPTY_DIM_OBJ                         1  ~13     ~12, 'rid'
          9        BOOL_NOT                                         ~14     ~13
         10        BOOL                                             ~9      ~14
         11    > > JMPZ                                                     ~9, ->112
    4    12    >   ASSIGN                                                   !0, 'http%3A%2F%2Fresults.vtu.ac.in%2Fvitavi.php'
    5    13        ASSIGN                                                   !1, 'Mozilla%2F4.0+%28compatible%3B+MSIE+6.0%3B+Windows+NT+5.1%3B+.NET+CLR+1.1.4322%29'
    6    14        INIT_FCALL_BY_NAME                                       'curl_init'
         15        DO_FCALL                                      0  $17     
         16        ASSIGN                                                   !2, $17
    7    17        INIT_FCALL_BY_NAME                                       'curl_setopt'
         18        SEND_VAR_EX                                              !2
         19        FETCH_CONSTANT                                   ~19     'CURLOPT_HEADER'
         20        SEND_VAL_EX                                              ~19
         21        SEND_VAL_EX                                              0
         22        DO_FCALL                                      0          
    8    23        INIT_FCALL_BY_NAME                                       'curl_setopt'
         24        SEND_VAR_EX                                              !2
         25        FETCH_CONSTANT                                   ~21     'CURLOPT_VERBOSE'
         26        SEND_VAL_EX                                              ~21
         27        SEND_VAL_EX                                              0
         28        DO_FCALL                                      0          
    9    29        INIT_FCALL_BY_NAME                                       'curl_setopt'
         30        SEND_VAR_EX                                              !2
         31        FETCH_CONSTANT                                   ~23     'CURLOPT_RETURNTRANSFER'
         32        SEND_VAL_EX                                              ~23
         33        SEND_VAL_EX                                              1
         34        DO_FCALL                                      0          
   10    35        INIT_FCALL_BY_NAME                                       'curl_setopt'
         36        SEND_VAR_EX                                              !2
         37        FETCH_CONSTANT                                   ~25     'CURLOPT_USERAGENT'
         38        SEND_VAL_EX                                              ~25
         39        SEND_VAR_EX                                              !1
         40        DO_FCALL                                      0          
   11    41        INIT_FCALL_BY_NAME                                       'curl_setopt'
         42        SEND_VAR_EX                                              !2
         43        FETCH_CONSTANT                                   ~27     'CURLOPT_POST'
         44        SEND_VAL_EX                                              ~27
         45        SEND_VAL_EX                                              1
         46        DO_FCALL                                      0          
   12    47        INIT_FCALL_BY_NAME                                       'curl_setopt'
         48        SEND_VAR_EX                                              !2
         49        FETCH_CONSTANT                                   ~29     'CURLOPT_URL'
         50        SEND_VAL_EX                                              ~29
         51        SEND_VAR_EX                                              !0
         52        DO_FCALL                                      0          
   14    53        FETCH_R                      global              ~31     '_POST'
         54        FETCH_DIM_R                                      ~32     ~31, 'rid'
         55        INIT_ARRAY                                       ~33     ~32, 'rid'
   15    56        ADD_ARRAY_ELEMENT                                ~33     'SUBMIT', 'submit'
   13    57        ASSIGN                                                   !3, ~33
   17    58        INIT_FCALL_BY_NAME                                       'curl_setopt'
         59        SEND_VAR_EX                                              !2
         60        FETCH_CONSTANT                                   ~35     'CURLOPT_POSTFIELDS'
         61        SEND_VAL_EX                                              ~35
         62        SEND_VAR_EX                                              !3
         63        DO_FCALL                                      0          
   18    64        INIT_FCALL_BY_NAME                                       'curl_exec'
         65        SEND_VAR_EX                                              !2
         66        DO_FCALL                                      0  $37     
         67        ASSIGN                                                   !4, $37
   21    68        ASSIGN                                                   !5, <array>
   23    69        INIT_FCALL                                               'stripos'
         70        SEND_VAR                                                 !4
         71        FETCH_DIM_R                                      ~40     !5, 'start'
         72        SEND_VAL                                                 ~40
         73        DO_ICALL                                         $41     
         74        ASSIGN                                                   !6, $41
   24    75        INIT_FCALL                                               'stripos'
         76        SEND_VAR                                                 !4
         77        FETCH_DIM_R                                      ~43     !5, 'end'
         78        SEND_VAL                                                 ~43
         79        DO_ICALL                                         $44     
         80        ASSIGN                                                   !7, $44
   25    81        INIT_FCALL                                               'substr'
         82        SEND_VAR                                                 !4
         83        SEND_VAR                                                 !6
         84        SEND_VAR                                                 !7
         85        DO_ICALL                                         $46     
         86        ASSIGN                                                   !4, $46
   27    87        CONCAT                                           ~48     !4, '%3Cbr%2F%3E'
         88        ECHO                                                     ~48
   28    89        ASSIGN                                                   !6, '%3CTD+width%3D%22513%22%3E'
   29    90        ASSIGN                                                   !7, '%3Cbr%3E'
   30    91        INIT_FCALL                                               'strstr'
         92        SEND_VAR                                                 !4
         93        SEND_VAR                                                 !6
         94        DO_ICALL                                         $51     
         95        ASSIGN                                                   !4, $51
   31    96        INIT_FCALL                                               'stripos'
         97        SEND_VAR                                                 !4
         98        SEND_VAR                                                 !7
         99        DO_ICALL                                         $53     
        100        ASSIGN                                                   !7, $53
   32   101        INIT_FCALL                                               'substr'
        102        SEND_VAR                                                 !4
        103        STRLEN                                           ~55     !6
        104        SEND_VAL                                                 ~55
        105        STRLEN                                           ~56     !6
        106        SUB                                              ~57     !7, ~56
        107        SEND_VAL                                                 ~57
        108        DO_ICALL                                         $58     
        109        ASSIGN                                                   !4, $58
   33   110        CONCAT                                           ~60     !4, '%3Cbr%2F%3E'
        111        ECHO                                                     ~60
   36   112    >   ECHO                                                     '%0A%3Chtml%3E%0A%3Cform+name%3D%22new%22+method%3D%22POST%22%3E%0A+%3Cp%3EEnter+the+University+Seat+No%3A+%3Cinput+type%3D%22TEXT%22+name%3D%22rid%22+size%3D%2220%22+maxlength%3D%2250%22%3E%3Cbr%3E%3Cbr%3E%3Cbr%3E%3Cbr%3E%0A+%3Cinput+type%3D%22SUBMIT%22+name%3D%22submit%22+value%3D%22SUBMIT%22+align%3D%22center%22%3E%3Cbr%3E%3C%2Fp%3E%0A%3C%2Fform%3E%0A%3C%2Fhtml%3E%0Aforeach%28%24xml-%3Expath%28%27%2F%2Fproduct%5Bstarts-with%28name%2Ftext%28%29%2C%22Shirt+12%22%29%5D%27%29+as+%24product%29%0A%7B%0A++++echo+%24product-%3Emathamatics%3B%0A++++echo+%22%5Cn%22%3B%0A++++echo+%24product-%3Eprice%3B%0A++++echo+%22%5Cn%22%3B%0A++++echo+%24product-%3Ecolor%3B%0A++++echo+%22%5Cn%5Cn%22%3B%0A%7D'
   51   113      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.52 ms | 1404 KiB | 19 Q