3v4l.org

run code in 300+ PHP versions simultaneously
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> <title>Arrays from User Input</title> </head> <body> <h2>How's your weather? </h2> <?php //If form not submitted, display form. if (!isset($_POST['submit'])){ ?> <form method="post" action="yourfile.php"> <p>Please enter your information:</p> City: <input type="text" name="city" /> Month: <input type="text" name="month" /> Year: <input type="text" name="year" /> <p>Please choose the kinds of weather you experienced from the list below. <br />Choose all that apply. </p> <input type="checkbox" name="weather[]" value="sunshine" />Sunshine<br /> <input type="checkbox" name="weather[]" value="clouds" />Clouds<br /> <input type="checkbox" name="weather[]" value="rain" />Rain<br /> <input type="checkbox" name="weather[]" value="hail" />Hail<br /> <input type="checkbox" name="weather[]" value="sleet" />Sleet<br /> <input type="checkbox" name="weather[]" value="snow" />Snow<br /> <input type="checkbox" name="weather[]" value="wind" />Wind<br /> <input type="checkbox" name="weather[]" value="cold" />Cold<br /> <input type="checkbox" name="weather[]" value="heat" />Heat<br /> <p /> <input type="submit" name="submit" value="Go" /> </form> <?php //If form submitted, process input. }else{ //Retrieve the date and location information. $inputLocal = array( $_POST['city'], $_POST['month'], $_POST['year'] ); echo "In $inputLocal[0] in the month of $inputLocal[1] $inputLocal[2], you observed the following weather:<br /> <ul>"; //Save weather array into a variable. $weather = $_POST['weather']; //Iterate through the array to show what the user chose. foreach($weather as $w){ echo "<li>$w</li>\n"; } echo "</ul>"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 38
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/03j8j
function name:  (null)
number of ops:  41
compiled vars:  !0 = $inputLocal, !1 = $weather, !2 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     'html+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22++xml%3Alang%3D%22en%22+lang%3D%22en%22%3E%0A%0A%3Chead%3E%0A%0A%3Cmeta+http-equiv%3D%22content-type%22+content%3D%22text%2Fhtml%3Bcharset%3Diso-8859-1%22+%2F%3E%0A%0A%3Ctitle%3EArrays+from+User+Input%3C%2Ftitle%3E%0A%0A%3C%2Fhead%3E%0A%0A+%0A%0A%3Cbody%3E%0A%0A%3Ch2%3EHow%27s+your+weather%3F+%3C%2Fh2%3E%0A%0A+%0A%0A'
   23     1        FETCH_IS                                         ~3      '_POST'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      ~3, 'submit'
          3        BOOL_NOT                                         ~5      ~4
          4      > JMPZ                                                     ~5, ->7
   26     5    >   ECHO                                                     '%0A%3Cform+method%3D%22post%22+action%3D%22yourfile.php%22%3E%0A%0A%3Cp%3EPlease+enter+your+information%3A%3C%2Fp%3E%0A%0ACity%3A+%3Cinput+type%3D%22text%22+name%3D%22city%22+%2F%3E%0A%0AMonth%3A+%3Cinput+type%3D%22text%22+name%3D%22month%22+%2F%3E%0A%0AYear%3A+%3Cinput+type%3D%22text%22+name%3D%22year%22+%2F%3E%0A%0A%3Cp%3EPlease+choose+the+kinds+of+weather+you+experienced+from+the+list+below.%0A%0A%3Cbr+%2F%3EChoose+all+that+apply.+%3C%2Fp%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22sunshine%22+%2F%3ESunshine%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22clouds%22+%2F%3EClouds%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22rain%22+%2F%3ERain%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22hail%22+%2F%3EHail%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22sleet%22+%2F%3ESleet%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22snow%22+%2F%3ESnow%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22wind%22+%2F%3EWind%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22cold%22+%2F%3ECold%3Cbr+%2F%3E%0A%0A%3Cinput+type%3D%22checkbox%22+name%3D%22weather%5B%5D%22+value%3D%22heat%22+%2F%3EHeat%3Cbr+%2F%3E%0A%0A%3Cp+%2F%3E%0A%0A%3Cinput+type%3D%22submit%22+name%3D%22submit%22+value%3D%22Go%22+%2F%3E%0A%0A%3C%2Fform%3E%0A%0A+%0A%0A'
          6      > JMP                                                      ->40
   77     7    >   FETCH_R                      global              ~6      '_POST'
          8        FETCH_DIM_R                                      ~7      ~6, 'city'
          9        INIT_ARRAY                                       ~8      ~7
   79    10        FETCH_R                      global              ~9      '_POST'
         11        FETCH_DIM_R                                      ~10     ~9, 'month'
         12        ADD_ARRAY_ELEMENT                                ~8      ~10
   81    13        FETCH_R                      global              ~11     '_POST'
         14        FETCH_DIM_R                                      ~12     ~11, 'year'
         15        ADD_ARRAY_ELEMENT                                ~8      ~12
   75    16        ASSIGN                                                   !0, ~8
   85    17        ROPE_INIT                                     7  ~18     'In+'
         18        FETCH_DIM_R                                      ~14     !0, 0
         19        ROPE_ADD                                      1  ~18     ~18, ~14
         20        ROPE_ADD                                      2  ~18     ~18, '+in+the+month+of+'
         21        FETCH_DIM_R                                      ~15     !0, 1
         22        ROPE_ADD                                      3  ~18     ~18, ~15
         23        ROPE_ADD                                      4  ~18     ~18, '+'
         24        FETCH_DIM_R                                      ~16     !0, 2
         25        ROPE_ADD                                      5  ~18     ~18, ~16
         26        ROPE_END                                      6  ~17     ~18, '%2C+you%0A%0A+observed+the+following+weather%3A%3Cbr+%2F%3E+%3Cul%3E'
         27        ECHO                                                     ~17
   91    28        FETCH_R                      global              ~22     '_POST'
         29        FETCH_DIM_R                                      ~23     ~22, 'weather'
         30        ASSIGN                                                   !1, ~23
   95    31      > FE_RESET_R                                       $25     !1, ->38
         32    > > FE_FETCH_R                                               $25, !2, ->38
   97    33    >   ROPE_INIT                                     3  ~27     '%3Cli%3E'
         34        ROPE_ADD                                      1  ~27     ~27, !2
         35        ROPE_END                                      2  ~26     ~27, '%3C%2Fli%3E%0A'
         36        ECHO                                                     ~26
   95    37      > JMP                                                      ->32
         38    >   FE_FREE                                                  $25
  101    39        ECHO                                                     '%3C%2Ful%3E'
  107    40    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.7 ms | 1399 KiB | 13 Q