3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE> <html> <head> <title> Zodiac </title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="zodiac.js"></script> </head> <body> <h1>What is your Zodiac Sign?</h1> <p>Enter your name and birthdate below to discover your zodiac sign!</p> <form action="zodiac.php" method="get"> <?php //ini_set("display_errors", 1); function findSign($name, $month, $date){ $intDate = intval($date); switch($month){ case "January": echo "January"; if($intDate <= 19){ echo "$name are a Capricorn"; } else{ echo "$name are a Aquarius"; } break; default: break; } } if(isset($_POST['submit'])){ $name = $_POST['name']; $month = $_POST['month']; $day = $_POST['day']; $year = $_POST['year']; echo "hi"; } ?> <input type="text" name="name" placeholder="Name" value="<?php echo $name; ?>" /> <br /> <?php //variables for year $startYear = 1950; $endYear = 2014; //making drop down menu for year echo '<select name="year" id="year">'; echo '<option value="">--Birth Year--</option>'; for(; $startYear <= $endYear; $startYear++){ echo '<option value="' . $startYear . '">' . $startYear . '</option>'; } echo '</select>'; //array list of strings for the months $month = array( "--Birth Month--", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ); //making a drop down menu for months echo '<select name="month" id="month">'; //echo '<option value="">--Birth Month--</option>'; for($i = 0; $i < count($month); $i++){ echo '<option value="' . $month[$i] . '">' . $month[$i] . '</option>'; } echo '</select>'; //variables for the day $startDay = 1; $endDay = 31; //making drop down menu for day echo '<select name="day" id="day">'; echo '<option value="">--Birth Day--</option>'; for(; $startDay <= $endDay; $startDay++){ echo '<option value="' . $startDay; if($day == $startDay){ echo 'checked="checked"'; } echo '">' . $startDay . '</option>'; } echo '</select>'; ?> <br /> <input type="submit" value="Submit" name="submit" /> <?php ?> </form> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 25
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 38
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 55
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 60
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 55
Branch analysis from position: 66
Branch analysis from position: 55
Branch analysis from position: 60
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 38
Branch analysis from position: 49
Branch analysis from position: 38
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 25
Branch analysis from position: 33
Branch analysis from position: 25
Branch analysis from position: 17
filename:       /in/Strqf
function name:  (null)
number of ops:  70
compiled vars:  !0 = $name, !1 = $month, !2 = $day, !3 = $year, !4 = $startYear, !5 = $endYear, !6 = $i, !7 = $startDay, !8 = $endDay
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21DOCTYPE%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%09%3Ctitle%3E%0A%09%09Zodiac%0A%09%3C%2Ftitle%3E%0A%09%3Cscript+src%3D%22http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.11.1%2Fjquery.min.js%22%3E%3C%2Fscript%3E%0A%09%3Cscript+src%3D%22zodiac.js%22%3E%3C%2Fscript%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Ch1%3EWhat+is+your+Zodiac+Sign%3F%3C%2Fh1%3E%0A%3Cp%3EEnter+your+name+and+birthdate+below+to+discover+your+zodiac+sign%21%3C%2Fp%3E%0A%0A%3Cform+action%3D%22zodiac.php%22+method%3D%22get%22%3E%0A'
   36     1        FETCH_IS                                         ~9      '_POST'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~9, 'submit'
          3      > JMPZ                                                     ~10, ->17
   38     4    >   FETCH_R                      global              ~11     '_POST'
          5        FETCH_DIM_R                                      ~12     ~11, 'name'
          6        ASSIGN                                                   !0, ~12
   39     7        FETCH_R                      global              ~14     '_POST'
          8        FETCH_DIM_R                                      ~15     ~14, 'month'
          9        ASSIGN                                                   !1, ~15
   40    10        FETCH_R                      global              ~17     '_POST'
         11        FETCH_DIM_R                                      ~18     ~17, 'day'
         12        ASSIGN                                                   !2, ~18
   41    13        FETCH_R                      global              ~20     '_POST'
         14        FETCH_DIM_R                                      ~21     ~20, 'year'
         15        ASSIGN                                                   !3, ~21
   43    16        ECHO                                                     'hi'
   48    17    >   ECHO                                                     '%09%3Cinput+type%3D%22text%22+name%3D%22name%22+placeholder%3D%22Name%22+value%3D%22'
         18        ECHO                                                     !0
         19        ECHO                                                     '%22+%2F%3E%0A%09%3Cbr+%2F%3E%0A'
   53    20        ASSIGN                                                   !4, 1950
   54    21        ASSIGN                                                   !5, 2014
   57    22        ECHO                                                     '%3Cselect+name%3D%22year%22+id%3D%22year%22%3E'
   58    23        ECHO                                                     '%3Coption+value%3D%22%22%3E--Birth+Year--%3C%2Foption%3E'
   59    24      > JMP                                                      ->31
   60    25    >   CONCAT                                           ~25     '%3Coption+value%3D%22', !4
         26        CONCAT                                           ~26     ~25, '%22%3E'
         27        CONCAT                                           ~27     ~26, !4
         28        CONCAT                                           ~28     ~27, '%3C%2Foption%3E'
         29        ECHO                                                     ~28
   59    30        PRE_INC                                                  !4
         31    >   IS_SMALLER_OR_EQUAL                                      !4, !5
         32      > JMPNZ                                                    ~30, ->25
   62    33    >   ECHO                                                     '%3C%2Fselect%3E'
   65    34        ASSIGN                                                   !1, <array>
   82    35        ECHO                                                     '%3Cselect+name%3D%22month%22+id%3D%22month%22%3E'
   84    36        ASSIGN                                                   !6, 0
         37      > JMP                                                      ->46
   85    38    >   FETCH_DIM_R                                      ~33     !1, !6
         39        CONCAT                                           ~34     '%3Coption+value%3D%22', ~33
         40        CONCAT                                           ~35     ~34, '%22%3E'
         41        FETCH_DIM_R                                      ~36     !1, !6
         42        CONCAT                                           ~37     ~35, ~36
         43        CONCAT                                           ~38     ~37, '%3C%2Foption%3E'
         44        ECHO                                                     ~38
   84    45        PRE_INC                                                  !6
         46    >   COUNT                                            ~40     !1
         47        IS_SMALLER                                               !6, ~40
         48      > JMPNZ                                                    ~41, ->38
   87    49    >   ECHO                                                     '%3C%2Fselect%3E'
   90    50        ASSIGN                                                   !7, 1
   91    51        ASSIGN                                                   !8, 31
   94    52        ECHO                                                     '%3Cselect+name%3D%22day%22+id%3D%22day%22%3E'
   95    53        ECHO                                                     '%3Coption+value%3D%22%22%3E--Birth+Day--%3C%2Foption%3E'
   96    54      > JMP                                                      ->64
   97    55    >   CONCAT                                           ~44     '%3Coption+value%3D%22', !7
         56        ECHO                                                     ~44
   98    57        IS_EQUAL                                                 !2, !7
         58      > JMPZ                                                     ~45, ->60
   99    59    >   ECHO                                                     'checked%3D%22checked%22'
  101    60    >   CONCAT                                           ~46     '%22%3E', !7
         61        CONCAT                                           ~47     ~46, '%3C%2Foption%3E'
         62        ECHO                                                     ~47
   96    63        PRE_INC                                                  !7
         64    >   IS_SMALLER_OR_EQUAL                                      !7, !8
         65      > JMPNZ                                                    ~49, ->55
  103    66    >   ECHO                                                     '%3C%2Fselect%3E'
  106    67        ECHO                                                     '%0A%09%3Cbr+%2F%3E%0A%09%3Cinput+type%3D%22submit%22+value%3D%22Submit%22+name%3D%22submit%22+%2F%3E%0A'
  112    68        ECHO                                                     '%3C%2Fform%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
  115    69      > RETURN                                                   1

Function findsign:
Finding entry points
Branch analysis from position: 0
3 jumps found. (Code = 188) Position 1 = 9, Position 2 = 20, Position 3 = 6
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 9
filename:       /in/Strqf
function name:  findSign
number of ops:  22
compiled vars:  !0 = $name, !1 = $month, !2 = $date, !3 = $intDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   20     3        CAST                                          4  ~4      !2
          4        ASSIGN                                                   !3, ~4
   21     5      > SWITCH_STRING                                            !1, [ 'January':->9, ], ->20
   22     6    >   IS_EQUAL                                                 !1, 'January'
          7      > JMPNZ                                                    ~6, ->9
          8    > > JMP                                                      ->20
   23     9    >   ECHO                                                     'January'
   24    10        IS_SMALLER_OR_EQUAL                                      !3, 19
         11      > JMPZ                                                     ~7, ->16
   25    12    >   NOP                                                      
         13        FAST_CONCAT                                      ~8      !0, '+are+a+Capricorn'
         14        ECHO                                                     ~8
         15      > JMP                                                      ->19
   28    16    >   NOP                                                      
         17        FAST_CONCAT                                      ~9      !0, '+are+a+Aquarius'
         18        ECHO                                                     ~9
   30    19    > > JMP                                                      ->21
   32    20    > > JMP                                                      ->21
   34    21    > > RETURN                                                   null

End of function findsign

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.88 ms | 1407 KiB | 13 Q