3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); $connect = new mysqli('localhost', 'username', 'password', 'db_name'); $connect->set_charset('utf8mb4'); // always set the charset if (isset($_POST['user_name'], $_POST['user_pass']) && $_POST['user_login'] == 1) { //Assigning posted values to variables. $username = $_POST['user_name']; $password = $_POST['user_pass']; //Checking the values are existing in the database or not $stmt = $connect->prepare("SELECT user_pass FROM users WHERE user_name=?"); $stmt->bind_param('s', $username); $stmt->execute(); $result = $stmt->get_result(); $user_from_db = $result->fetch_object(); if ($user_from_db && password_verify($password, $user_from_db->user_pass)) { $_SESSION['pageadmin'] = true; $_SESSION['user_name'] = $username; } else { //If the login credentials doesn't match, he will be shown with an error message. echo "Invalid Login Credentials."; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 68
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 53, Position 2 = 59
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 67
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 68
Branch analysis from position: 29
Branch analysis from position: 24
filename:       /in/evQeq
function name:  (null)
number of ops:  69
compiled vars:  !0 = $connect, !1 = $username, !2 = $password, !3 = $stmt, !4 = $result, !5 = $user_from_db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    5     2        INIT_FCALL_BY_NAME                                       'mysqli_report'
          3        FETCH_CONSTANT                                   ~7      'MYSQLI_REPORT_ERROR'
          4        FETCH_CONSTANT                                   ~8      'MYSQLI_REPORT_STRICT'
          5        BW_OR                                            ~9      ~7, ~8
          6        SEND_VAL_EX                                              ~9
          7        DO_FCALL                                      0          
    6     8        NEW                                              $11     'mysqli'
          9        SEND_VAL_EX                                              'localhost'
         10        SEND_VAL_EX                                              'username'
         11        SEND_VAL_EX                                              'password'
         12        SEND_VAL_EX                                              'db_name'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !0, $11
    7    15        INIT_METHOD_CALL                                         !0, 'set_charset'
         16        SEND_VAL_EX                                              'utf8mb4'
         17        DO_FCALL                                      0          
    9    18        FETCH_IS                                         ~15     '_POST'
         19        ISSET_ISEMPTY_DIM_OBJ                         0  ~16     ~15, 'user_name'
         20      > JMPZ_EX                                          ~16     ~16, ->24
         21    >   FETCH_IS                                         ~17     '_POST'
         22        ISSET_ISEMPTY_DIM_OBJ                         0  ~18     ~17, 'user_pass'
         23        BOOL                                             ~16     ~18
         24    > > JMPZ_EX                                          ~16     ~16, ->29
         25    >   FETCH_R                      global              ~19     '_POST'
         26        FETCH_DIM_R                                      ~20     ~19, 'user_login'
         27        IS_EQUAL                                         ~21     ~20, 1
         28        BOOL                                             ~16     ~21
         29    > > JMPZ                                                     ~16, ->68
   11    30    >   FETCH_R                      global              ~22     '_POST'
         31        FETCH_DIM_R                                      ~23     ~22, 'user_name'
         32        ASSIGN                                                   !1, ~23
   12    33        FETCH_R                      global              ~25     '_POST'
         34        FETCH_DIM_R                                      ~26     ~25, 'user_pass'
         35        ASSIGN                                                   !2, ~26
   15    36        INIT_METHOD_CALL                                         !0, 'prepare'
         37        SEND_VAL_EX                                              'SELECT+user_pass+FROM+users+WHERE+user_name%3D%3F'
         38        DO_FCALL                                      0  $28     
         39        ASSIGN                                                   !3, $28
   16    40        INIT_METHOD_CALL                                         !3, 'bind_param'
         41        SEND_VAL_EX                                              's'
         42        SEND_VAR_EX                                              !1
         43        DO_FCALL                                      0          
   17    44        INIT_METHOD_CALL                                         !3, 'execute'
         45        DO_FCALL                                      0          
   18    46        INIT_METHOD_CALL                                         !3, 'get_result'
         47        DO_FCALL                                      0  $32     
         48        ASSIGN                                                   !4, $32
   19    49        INIT_METHOD_CALL                                         !4, 'fetch_object'
         50        DO_FCALL                                      0  $34     
         51        ASSIGN                                                   !5, $34
   21    52      > JMPZ_EX                                          ~36     !5, ->59
         53    >   INIT_FCALL                                               'password_verify'
         54        SEND_VAR                                                 !2
         55        FETCH_OBJ_R                                      ~37     !5, 'user_pass'
         56        SEND_VAL                                                 ~37
         57        DO_ICALL                                         $38     
         58        BOOL                                             ~36     $38
         59    > > JMPZ                                                     ~36, ->67
   22    60    >   FETCH_W                      global              $39     '_SESSION'
         61        ASSIGN_DIM                                               $39, 'pageadmin'
         62        OP_DATA                                                  <true>
   23    63        FETCH_W                      global              $41     '_SESSION'
         64        ASSIGN_DIM                                               $41, 'user_name'
         65        OP_DATA                                                  !1
   21    66      > JMP                                                      ->68
   26    67    >   ECHO                                                     'Invalid+Login+Credentials.'
   28    68    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
247 ms | 1016 KiB | 15 Q