3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <title>Process the HTML form data with the POST method</title> </head> <body> <form name="myform" action="process.php" method="POST"> <input type="hidden" name="check_submit" value="1" /> Name: <input type="text" name="Name" /><br /> Password: <input type="password" name="Password" maxlength="10" /><br /> Select something from the list: <select name="Seasons"> <option value="Spring" selected="selected">Spring</option> <option value="Summer">Summer</option> <option value="Autumn">Autumn</option> <option value="Winter">Winter</option> </select><br /><br /> Choose one: <input type="radio" name="Country" value="USA" /> USA <input type="radio" name="Country" value="Canada" /> Canada <input type="radio" name="Country" value="Other" /> Other <br /> Choose the colors: <input type="checkbox" name="Colors[]" value="green" checked="checked" /> Green <input type="checkbox" name="Colors[]" value="yellow" /> Yellow <input type="checkbox" name="Colors[]" value="red" /> Red <input type="checkbox" name="Colors[]" value="gray" /> Gray <br /><br /> Comments:<br /> <textarea name="Comments" rows="10" cols="60">Enter your comments here</textarea><br /> <input type="submit" /> </form> <?php //Check whether the form has been submitted if (array_key_exists('check_submit', $_POST)) { //Converts the new line characters (\n) in the text area into HTML line breaks (the <br /> tag) $_POST['Comments'] = nl2br($_POST['Comments']); //Check whether a $_GET['Languages'] is set if ( isset($_POST['Colors']) ) { $_POST['Colors'] = implode(', ', $_POST['Colors']); //Converts an array into a single string } //Let's now print out the received values in the browser echo "Your name: {$_POST['Name']}<br />"; echo "Your password: {$_POST['Password']}<br />"; echo "Your favourite season: {$_POST['Seasons']}<br /><br />"; echo "Your comments:<br />{$_POST['Comments']}<br /><br />"; echo "You are from: {$_POST['Country']}<br />"; echo "Colors you chose: {$_POST['Colors']}<br />"; } else { echo "You can't see this page without submitting the form."; } ?> </body> </head> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 61
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q3cjn
function name:  (null)
number of ops:  64
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Chtml%3E+%0A%3Chead%3E+%0A++%3Ctitle%3EProcess+the+HTML+form+data+with+the+POST+method%3C%2Ftitle%3E+%0A%3C%2Fhead%3E+%0A%3Cbody%3E+%0A++%3Cform+name%3D%22myform%22+action%3D%22process.php%22+method%3D%22POST%22%3E%0A++++%3Cinput+type%3D%22hidden%22+name%3D%22check_submit%22+value%3D%221%22+%2F%3E%0A++++Name%3A+%3Cinput+type%3D%22text%22+name%3D%22Name%22+%2F%3E%3Cbr+%2F%3E%0A++++Password%3A+%3Cinput+type%3D%22password%22+name%3D%22Password%22+maxlength%3D%2210%22+%2F%3E%3Cbr+%2F%3E%0A++++Select+something+from+the+list%3A+%3Cselect+name%3D%22Seasons%22%3E%0A++++++%3Coption+value%3D%22Spring%22+selected%3D%22selected%22%3ESpring%3C%2Foption%3E%0A++++++%3Coption+value%3D%22Summer%22%3ESummer%3C%2Foption%3E%0A++++++%3Coption+value%3D%22Autumn%22%3EAutumn%3C%2Foption%3E%0A++++++%3Coption+value%3D%22Winter%22%3EWinter%3C%2Foption%3E%0A++++%3C%2Fselect%3E%3Cbr+%2F%3E%3Cbr+%2F%3E%0A++++Choose+one%3A+%0A++++++%3Cinput+type%3D%22radio%22+name%3D%22Country%22+value%3D%22USA%22+%2F%3E+USA%0A++++++%3Cinput+type%3D%22radio%22+name%3D%22Country%22+value%3D%22Canada%22+%2F%3E+Canada%0A++++++%3Cinput+type%3D%22radio%22+name%3D%22Country%22+value%3D%22Other%22+%2F%3E+Other%0A++++%3Cbr+%2F%3E%0A++++Choose+the+colors%3A+%0A++++++%3Cinput+type%3D%22checkbox%22+name%3D%22Colors%5B%5D%22+value%3D%22green%22+checked%3D%22checked%22+%2F%3E+Green%0A++++++%3Cinput+type%3D%22checkbox%22+name%3D%22Colors%5B%5D%22+value%3D%22yellow%22+%2F%3E+Yellow%0A++++++%3Cinput+type%3D%22checkbox%22+name%3D%22Colors%5B%5D%22+value%3D%22red%22+%2F%3E+Red%0A++++++%3Cinput+type%3D%22checkbox%22+name%3D%22Colors%5B%5D%22+value%3D%22gray%22+%2F%3E+Gray%0A++++%3Cbr+%2F%3E%3Cbr+%2F%3E%0A++++Comments%3A%3Cbr+%2F%3E+%0A++++%3Ctextarea+name%3D%22Comments%22+rows%3D%2210%22+cols%3D%2260%22%3EEnter+your+comments+here%3C%2Ftextarea%3E%3Cbr+%2F%3E%0A++++%3Cinput+type%3D%22submit%22+%2F%3E%0A++%3C%2Fform%3E%0A++++'
   33     1        FETCH_R                      global              ~0      '_POST'
          2        ARRAY_KEY_EXISTS                                         'check_submit', ~0
          3      > JMPZ                                                     ~1, ->61
   35     4    >   INIT_FCALL                                               'nl2br'
          5        FETCH_R                      global              ~4      '_POST'
          6        FETCH_DIM_R                                      ~5      ~4, 'Comments'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                         $6      
          9        FETCH_W                      global              $2      '_POST'
         10        ASSIGN_DIM                                               $2, 'Comments'
         11        OP_DATA                                                  $6
   37    12        FETCH_IS                                         ~7      '_POST'
         13        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, 'Colors'
         14      > JMPZ                                                     ~8, ->24
   38    15    >   INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '%2C+'
         17        FETCH_R                      global              ~11     '_POST'
         18        FETCH_DIM_R                                      ~12     ~11, 'Colors'
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                         $13     
         21        FETCH_W                      global              $9      '_POST'
         22        ASSIGN_DIM                                               $9, 'Colors'
         23        OP_DATA                                                  $13
   42    24    >   ROPE_INIT                                     3  ~17     'Your+name%3A+'
         25        FETCH_R                      global              ~14     '_POST'
         26        FETCH_DIM_R                                      ~15     ~14, 'Name'
         27        ROPE_ADD                                      1  ~17     ~17, ~15
         28        ROPE_END                                      2  ~16     ~17, '%3Cbr+%2F%3E'
         29        ECHO                                                     ~16
   43    30        ROPE_INIT                                     3  ~22     'Your+password%3A+'
         31        FETCH_R                      global              ~19     '_POST'
         32        FETCH_DIM_R                                      ~20     ~19, 'Password'
         33        ROPE_ADD                                      1  ~22     ~22, ~20
         34        ROPE_END                                      2  ~21     ~22, '%3Cbr+%2F%3E'
         35        ECHO                                                     ~21
   44    36        ROPE_INIT                                     3  ~27     'Your+favourite+season%3A+'
         37        FETCH_R                      global              ~24     '_POST'
         38        FETCH_DIM_R                                      ~25     ~24, 'Seasons'
         39        ROPE_ADD                                      1  ~27     ~27, ~25
         40        ROPE_END                                      2  ~26     ~27, '%3Cbr+%2F%3E%3Cbr+%2F%3E'
         41        ECHO                                                     ~26
   45    42        ROPE_INIT                                     3  ~32     'Your+comments%3A%3Cbr+%2F%3E'
         43        FETCH_R                      global              ~29     '_POST'
         44        FETCH_DIM_R                                      ~30     ~29, 'Comments'
         45        ROPE_ADD                                      1  ~32     ~32, ~30
         46        ROPE_END                                      2  ~31     ~32, '%3Cbr+%2F%3E%3Cbr+%2F%3E'
         47        ECHO                                                     ~31
   46    48        ROPE_INIT                                     3  ~37     'You+are+from%3A+'
         49        FETCH_R                      global              ~34     '_POST'
         50        FETCH_DIM_R                                      ~35     ~34, 'Country'
         51        ROPE_ADD                                      1  ~37     ~37, ~35
         52        ROPE_END                                      2  ~36     ~37, '%3Cbr+%2F%3E'
         53        ECHO                                                     ~36
   47    54        ROPE_INIT                                     3  ~42     'Colors+you+chose%3A+'
         55        FETCH_R                      global              ~39     '_POST'
         56        FETCH_DIM_R                                      ~40     ~39, 'Colors'
         57        ROPE_ADD                                      1  ~42     ~42, ~40
         58        ROPE_END                                      2  ~41     ~42, '%3Cbr+%2F%3E'
         59        ECHO                                                     ~41
         60      > JMP                                                      ->62
   49    61    >   ECHO                                                     'You+can%27t+see+this+page+without+submitting+the+form.'
   52    62    >   ECHO                                                     '%3C%2Fbody%3E%0A%3C%2Fhead%3E%0A%3C%2Fhtml%3E'
   54    63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.04 ms | 1409 KiB | 17 Q