3v4l.org

run code in 500+ PHP versions simultaneously
<?php session_start(); $erreur = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { $utilisateur = $_POST["username"]; $motdepasse = $_POST["password"]; // Identifiants de démonstration if ($utilisateur == "admin" && $motdepasse == "1234") { $_SESSION["username"] = $utilisateur; header("Location: bienvenue.php"); exit(); } else { $erreur = "Nom d'utilisateur ou mot de passe incorrect."; } } ?> <!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <title>Connexion</title> </head> <body> <h2>Connexion</h2> <?php if (!empty($erreur)) : ?> <p style="color:red;"><?php echo $erreur; ?></p> <?php endif; ?> <form method="POST"> <label>Nom d'utilisateur :</label><br> <input type="text" name="username" required><br><br> <label>Mot de passe :</label><br> <input type="password" name="password" required><br><br> <button type="submit">Se connecter</button> </form> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 28
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 17
Branch analysis from position: 28
filename:       /in/N1pdU
function name:  (null)
number of ops:  37
compiled vars:  !0 = $erreur, !1 = $utilisateur, !2 = $motdepasse
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'session_start'
          1        DO_ICALL                                                     
    4     2        ASSIGN                                                       !0, ''
    6     3        FETCH_R                          global              ~5      '_SERVER'
          4        FETCH_DIM_R                                          ~6      ~5, 'REQUEST_METHOD'
          5        IS_EQUAL                                                     ~6, 'POST'
          6      > JMPZ                                                         ~7, ->28
    7     7    >   FETCH_R                          global              ~8      '_POST'
          8        FETCH_DIM_R                                          ~9      ~8, 'username'
          9        ASSIGN                                                       !1, ~9
    8    10        FETCH_R                          global              ~11     '_POST'
         11        FETCH_DIM_R                                          ~12     ~11, 'password'
         12        ASSIGN                                                       !2, ~12
   11    13        IS_EQUAL                                             ~14     !1, 'admin'
         14      > JMPZ_EX                                              ~14     ~14, ->17
         15    >   IS_EQUAL                                             ~15     !2, '1234'
         16        BOOL                                                 ~14     ~15
         17    > > JMPZ                                                         ~14, ->27
   12    18    >   FETCH_W                          global              $16     '_SESSION'
         19        ASSIGN_DIM                                                   $16, 'username'
         20        OP_DATA                                                      !1
   13    21        INIT_FCALL                                                   'header'
         22        SEND_VAL                                                     'Location%3A+bienvenue.php'
         23        DO_ICALL                                                     
   14    24      > INIT_FCALL                                                   'exit'
         25*       DO_ICALL                                                     
   11    26*       JMP                                                          ->28
   16    27    >   ASSIGN                                                       !0, 'Nom+d%27utilisateur+ou+mot+de+passe+incorrect.'
   20    28    >   ECHO                                                         '%0A%3C%21DOCTYPE+html%3E%0A%3Chtml+lang%3D%22fr%22%3E%0A%3Chead%3E%0A++++%3Cmeta+charset%3D%22UTF-8%22%3E%0A++++%3Ctitle%3EConnexion%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%0A%3Ch2%3EConnexion%3C%2Fh2%3E%0A%0A'
   31    29        ISSET_ISEMPTY_CV                                     ~21     !0
         30        BOOL_NOT                                             ~22     ~21
         31      > JMPZ                                                         ~22, ->35
   32    32    >   ECHO                                                         '++++%3Cp+style%3D%22color%3Ared%3B%22%3E'
         33        ECHO                                                         !0
         34        ECHO                                                         '%3C%2Fp%3E%0A'
   34    35    >   ECHO                                                         '%0A%3Cform+method%3D%22POST%22%3E%0A++++%3Clabel%3ENom+d%27utilisateur+%3A%3C%2Flabel%3E%3Cbr%3E%0A++++%3Cinput+type%3D%22text%22+name%3D%22username%22+required%3E%3Cbr%3E%3Cbr%3E%0A%0A++++%3Clabel%3EMot+de+passe+%3A%3C%2Flabel%3E%3Cbr%3E%0A++++%3Cinput+type%3D%22password%22+name%3D%22password%22+required%3E%3Cbr%3E%3Cbr%3E%0A%0A++++%3Cbutton+type%3D%22submit%22%3ESe+connecter%3C%2Fbutton%3E%0A%3C%2Fform%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   46    36      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.18 ms | 1395 KiB | 16 Q