3v4l.org

run code in 300+ PHP versions simultaneously
<?php $request = 'http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc'; $response = file_get_contents($request); $data=json_decode($response,true); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: <?php echo $_POST['name']; ?> Country: <?php echo $_POST['country']; ?> </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> <?php $count = $data['cnt']; $country; if($_POST['filter']){ if($_POST['country']){ $country = $_POST['country']; for($i = 0; $i < $count; $i++){ if($data['list'][$i]['sys']['country'] == $country){ echo "<tr>"; echo "<td>".$data['list'][$i]['id']."</td>"; echo "<td>".$data['list'][$i]['name']."</td>"; echo "<td>".$data['list'][$i]['sys']['country']."</td>"; echo "</tr>"; } else continue; } } if ($_POST['name']) { $name = $_POST['name']; for($i = 0; $i < $count; $i++){ if($data['list'][$i]['name'] == $name){ echo "<tr>"; echo "<td>".$data['list'][$i]['id']."</td>"; echo "<td>".$data['list'][$i]['name']."</td>"; echo "<td>".$data['list'][$i]['sys']['country']."</td>"; echo "</tr>"; } else continue; } } } else{ for($i = 0; $i < $count; $i++){ echo "<tr>"; echo "<td>".$data['list'][$i]['id']."</td>"; echo "<td>".$data['list'][$i]['name']."</td>"; echo "<td>".$data['list'][$i]['sys']['country']."</td>"; echo "</tr>"; } } ?> </table> </div> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 104
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 64
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 32
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 103
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 101
Branch analysis from position: 101
2 jumps found. (Code = 44) Position 1 = 103, Position 2 = 72
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 130
Branch analysis from position: 130
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 99
Branch analysis from position: 77
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
2 jumps found. (Code = 44) Position 1 = 103, Position 2 = 72
Branch analysis from position: 103
Branch analysis from position: 72
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
Branch analysis from position: 103
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 60
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 32
Branch analysis from position: 64
Branch analysis from position: 32
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 64
Branch analysis from position: 104
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
2 jumps found. (Code = 44) Position 1 = 130, Position 2 = 106
Branch analysis from position: 130
Branch analysis from position: 106
2 jumps found. (Code = 44) Position 1 = 130, Position 2 = 106
Branch analysis from position: 130
Branch analysis from position: 106
filename:       /in/fKb5O
function name:  (null)
number of ops:  132
compiled vars:  !0 = $request, !1 = $response, !2 = $data, !3 = $count, !4 = $country, !5 = $i, !6 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fapi.openweathermap.org%2Fdata%2F2.5%2Fgroup%3Fid%3D4880731%2C5000598%2C5128581%2C5368361%2C4887398%2C5391811%2C4930956%2C1275339%2C1273294%2C1275004%2C1264527%2C524901%2C703448%2C2643743%2C1816670%2C292223%26APPID%3Dea2cc999e9e272185de78f08e2e738fc'
    4     1        INIT_FCALL                                               'file_get_contents'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $8      
          4        ASSIGN                                                   !1, $8
    5     5        INIT_FCALL                                               'json_decode'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $10     
          9        ASSIGN                                                   !2, $10
    8    10        ECHO                                                     '%0A%3C%21DOCTYPE+html%3E%0A%3Chtml+lang%3D%22en%22%3E%0A%09%3Chead%3E%0A%09%09%3Cmeta+charset+%3D+%22UTF-8%22+%2F%3E%0A%09%09%3Cmeta+name%3D%22author%22+content%3D%22Chaitanya%22+%2F%3E%0A%09%09%3Cmeta+name%3D%22keywords%22+content%3D%22countries%2C+country+id%22+%2F%3E%0A%09%09%3Clink+rel%3D%22stylesheet%22+type%3D%22text%2Fcss%22+href%3D%22style.css%22+%2F%3E%0A%09%09%3Ctitle%3EPHP+Application%3C%2Ftitle%3E%0A%09%3C%2Fhead%3E%0A%09%0A%09%3Cbody%3E%0A%09%09%3Cdiv+class+%3D+%22main-wrap%22%3E%0A%09%09%09%3Ch2%3EPHP+Web+Assignment+Task%3C%2Fh2%3E%0A%09%09%09%3Chr+%2F%3E%3Cbr+%2F%3E%0A%09%09%09%0A%09%09%09%09%0A%09%09%09%09%0A%09%09%09++++%3Cform+action%3D%22index.php%22+method%3D%22post%22%3E%0A%09%09+++++++++++%3Cpre%3EName%3A+%3Cinput+type%3D%22text%22+name%3D%22name%22%2F%3E++++Country%3A+%3Cinput+type%3D%22text%22+name%3D%22country%22%3E++++%3Cinput+type%3D%22submit%22+name%3D%22filter%22+value%3D%22Filter%22%3E%3C%2Fpre%3E%0A%09%09+++++++++++%3Cbr%3E%3Cbr%3E%0A%09%09+++++++++%3C%2Fform%3E%0A%09%09+++++++++%0A%09%09++++++++Search+Term%3A%3Cbr+%2F%3E%0A%09%09++++++++%3Cpre%3EName%3A+'
   32    11        FETCH_R                      global              ~12     '_POST'
         12        FETCH_DIM_R                                      ~13     ~12, 'name'
         13        ECHO                                                     ~13
   33    14        ECHO                                                     '%09%09++++++++%09+Country%3A+'
         15        FETCH_R                      global              ~14     '_POST'
         16        FETCH_DIM_R                                      ~15     ~14, 'country'
         17        ECHO                                                     ~15
   34    18        ECHO                                                     '%09%09++++++++%3C%2Fpre%3E%0A%09%09++++++++%0A%09%09++++++++%3Cbr+%2F%3E%0A%09%09++++++++%0A%09%09++++++++%3Ctable+border%3D%221%22+cellspacing%3D%225%22+width%3D%22100%25%22+style%3D%22text-align%3A+center%22%3E%0A%09%09+++++++++++%09%09%0A%09%09+++++++++++%09%09%3Ctr%3E%0A%09%09%09%09%09%09%09%3Cth%3EID%3C%2Fth%3E%0A%09%09%09%09%09%09%09%3Cth%3EName%3C%2Fth%3E%0A%09%09%09%09%09%09%09%3Cth%3ECountry%3C%2Fth%3E%0A%09%09%09%09%09%09%3C%2Ftr%3E%0A%09%09%09%09%09%09%0A%09%09%09%09%09%09%0A%09%09+++++++++++%09%0A%09%09+++++++++++%09%09'
   50    19        FETCH_DIM_R                                      ~16     !2, 'cnt'
         20        ASSIGN                                                   !3, ~16
   56    21        FETCH_R                      global              ~18     '_POST'
         22        FETCH_DIM_R                                      ~19     ~18, 'filter'
         23      > JMPZ                                                     ~19, ->104
   58    24    >   FETCH_R                      global              ~20     '_POST'
         25        FETCH_DIM_R                                      ~21     ~20, 'country'
         26      > JMPZ                                                     ~21, ->64
   59    27    >   FETCH_R                      global              ~22     '_POST'
         28        FETCH_DIM_R                                      ~23     ~22, 'country'
         29        ASSIGN                                                   !4, ~23
   60    30        ASSIGN                                                   !5, 0
         31      > JMP                                                      ->62
   62    32    >   FETCH_DIM_R                                      ~26     !2, 'list'
         33        FETCH_DIM_R                                      ~27     ~26, !5
         34        FETCH_DIM_R                                      ~28     ~27, 'sys'
         35        FETCH_DIM_R                                      ~29     ~28, 'country'
         36        IS_EQUAL                                                 !4, ~29
         37      > JMPZ                                                     ~30, ->60
   63    38    >   ECHO                                                     '%3Ctr%3E'
   64    39        FETCH_DIM_R                                      ~31     !2, 'list'
         40        FETCH_DIM_R                                      ~32     ~31, !5
         41        FETCH_DIM_R                                      ~33     ~32, 'id'
         42        CONCAT                                           ~34     '%3Ctd%3E', ~33
         43        CONCAT                                           ~35     ~34, '%3C%2Ftd%3E'
         44        ECHO                                                     ~35
   65    45        FETCH_DIM_R                                      ~36     !2, 'list'
         46        FETCH_DIM_R                                      ~37     ~36, !5
         47        FETCH_DIM_R                                      ~38     ~37, 'name'
         48        CONCAT                                           ~39     '%3Ctd%3E', ~38
         49        CONCAT                                           ~40     ~39, '%3C%2Ftd%3E'
         50        ECHO                                                     ~40
   66    51        FETCH_DIM_R                                      ~41     !2, 'list'
         52        FETCH_DIM_R                                      ~42     ~41, !5
         53        FETCH_DIM_R                                      ~43     ~42, 'sys'
         54        FETCH_DIM_R                                      ~44     ~43, 'country'
         55        CONCAT                                           ~45     '%3Ctd%3E', ~44
         56        CONCAT                                           ~46     ~45, '%3C%2Ftd%3E'
         57        ECHO                                                     ~46
   67    58        ECHO                                                     '%3C%2Ftr%3E'
         59      > JMP                                                      ->61
   69    60    > > JMP                                                      ->61
   60    61    >   PRE_INC                                                  !5
         62    >   IS_SMALLER                                               !5, !3
         63      > JMPNZ                                                    ~48, ->32
   74    64    >   FETCH_R                      global              ~49     '_POST'
         65        FETCH_DIM_R                                      ~50     ~49, 'name'
         66      > JMPZ                                                     ~50, ->103
   75    67    >   FETCH_R                      global              ~51     '_POST'
         68        FETCH_DIM_R                                      ~52     ~51, 'name'
         69        ASSIGN                                                   !6, ~52
   76    70        ASSIGN                                                   !5, 0
         71      > JMP                                                      ->101
   78    72    >   FETCH_DIM_R                                      ~55     !2, 'list'
         73        FETCH_DIM_R                                      ~56     ~55, !5
         74        FETCH_DIM_R                                      ~57     ~56, 'name'
         75        IS_EQUAL                                                 !6, ~57
         76      > JMPZ                                                     ~58, ->99
   79    77    >   ECHO                                                     '%3Ctr%3E'
   80    78        FETCH_DIM_R                                      ~59     !2, 'list'
         79        FETCH_DIM_R                                      ~60     ~59, !5
         80        FETCH_DIM_R                                      ~61     ~60, 'id'
         81        CONCAT                                           ~62     '%3Ctd%3E', ~61
         82        CONCAT                                           ~63     ~62, '%3C%2Ftd%3E'
         83        ECHO                                                     ~63
   81    84        FETCH_DIM_R                                      ~64     !2, 'list'
         85        FETCH_DIM_R                                      ~65     ~64, !5
         86        FETCH_DIM_R                                      ~66     ~65, 'name'
         87        CONCAT                                           ~67     '%3Ctd%3E', ~66
         88        CONCAT                                           ~68     ~67, '%3C%2Ftd%3E'
         89        ECHO                                                     ~68
   82    90        FETCH_DIM_R                                      ~69     !2, 'list'
         91        FETCH_DIM_R                                      ~70     ~69, !5
         92        FETCH_DIM_R                                      ~71     ~70, 'sys'
         93        FETCH_DIM_R                                      ~72     ~71, 'country'
         94        CONCAT                                           ~73     '%3Ctd%3E', ~72
         95        CONCAT                                           ~74     ~73, '%3C%2Ftd%3E'
         96        ECHO                                                     ~74
   83    97        ECHO                                                     '%3C%2Ftr%3E'
         98      > JMP                                                      ->100
   85    99    > > JMP                                                      ->100
   76   100    >   PRE_INC                                                  !5
        101    >   IS_SMALLER                                               !5, !3
        102      > JMPNZ                                                    ~76, ->72
        103    > > JMP                                                      ->130
   95   104    >   ASSIGN                                                   !5, 0
        105      > JMP                                                      ->128
   96   106    >   ECHO                                                     '%3Ctr%3E'
   97   107        FETCH_DIM_R                                      ~78     !2, 'list'
        108        FETCH_DIM_R                                      ~79     ~78, !5
        109        FETCH_DIM_R                                      ~80     ~79, 'id'
        110        CONCAT                                           ~81     '%3Ctd%3E', ~80
        111        CONCAT                                           ~82     ~81, '%3C%2Ftd%3E'
        112        ECHO                                                     ~82
   98   113        FETCH_DIM_R                                      ~83     !2, 'list'
        114        FETCH_DIM_R                                      ~84     ~83, !5
        115        FETCH_DIM_R                                      ~85     ~84, 'name'
        116        CONCAT                                           ~86     '%3Ctd%3E', ~85
        117        CONCAT                                           ~87     ~86, '%3C%2Ftd%3E'
        118        ECHO                                                     ~87
   99   119        FETCH_DIM_R                                      ~88     !2, 'list'
        120        FETCH_DIM_R                                      ~89     ~88, !5
        121        FETCH_DIM_R                                      ~90     ~89, 'sys'
        122        FETCH_DIM_R                                      ~91     ~90, 'country'
        123        CONCAT                                           ~92     '%3Ctd%3E', ~91
        124        CONCAT                                           ~93     ~92, '%3C%2Ftd%3E'
        125        ECHO                                                     ~93
  100   126        ECHO                                                     '%3C%2Ftr%3E'
   95   127        PRE_INC                                                  !5
        128    >   IS_SMALLER                                               !5, !3
        129      > JMPNZ                                                    ~95, ->106
  105   130    >   ECHO                                                     '%09%09+++++++++++%09%0A%09%09+++++++++++%3C%2Ftable%3E%0A%09%09++++++++%0A%09%09++++++%09%09%09%09%0A%09%09%3C%2Fdiv%3E%0A%09%3C%2Fbody%3E%0A%09%0A%3C%2Fhtml%3E'
  112   131      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.61 ms | 1408 KiB | 17 Q