3v4l.org

run code in 300+ PHP versions simultaneously
<?php require 'path/to/login_utils.php'; $username = $_POST['username']; // NO "custom cleaning function from login_utils" should be ever used here $userpass = $_POST['userpass']; $pdo = connect_to_database(); // custom connection function from login_utils $select = "SELECT `password` FROM `tbl_login` WHERE `username`=:username;"; $prepared = $conn->prepare($select); $prepared->execute([$username]); $result = $prepared->fetch(PDO::FETCH_ASSOC); if ($result && password_verify($userpass, $password)) { start_authenticated_session(); // custom session starting function from login_utils echo 'You have been logged in'; } die ('Invalid username and password combo');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 33
Branch analysis from position: 30
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 29
filename:       /in/jT1Gr
function name:  (null)
number of ops:  35
compiled vars:  !0 = $username, !1 = $userpass, !2 = $pdo, !3 = $select, !4 = $prepared, !5 = $conn, !6 = $result, !7 = $password
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INCLUDE_OR_EVAL                                          'path%2Fto%2Flogin_utils.php', REQUIRE
    5     1        FETCH_R                      global              ~9      '_POST'
          2        FETCH_DIM_R                                      ~10     ~9, 'username'
          3        ASSIGN                                                   !0, ~10
    6     4        FETCH_R                      global              ~12     '_POST'
          5        FETCH_DIM_R                                      ~13     ~12, 'userpass'
          6        ASSIGN                                                   !1, ~13
    8     7        INIT_FCALL_BY_NAME                                       'connect_to_database'
          8        DO_FCALL                                      0  $15     
          9        ASSIGN                                                   !2, $15
    9    10        ASSIGN                                                   !3, 'SELECT+%60password%60+FROM+%60tbl_login%60+WHERE+%60username%60%3D%3Ausername%3B'
   10    11        INIT_METHOD_CALL                                         !5, 'prepare'
         12        SEND_VAR_EX                                              !3
         13        DO_FCALL                                      0  $18     
         14        ASSIGN                                                   !4, $18
   11    15        INIT_METHOD_CALL                                         !4, 'execute'
         16        INIT_ARRAY                                       ~20     !0
         17        SEND_VAL_EX                                              ~20
         18        DO_FCALL                                      0          
   12    19        INIT_METHOD_CALL                                         !4, 'fetch'
         20        SEND_VAL_EX                                              2
         21        DO_FCALL                                      0  $22     
         22        ASSIGN                                                   !6, $22
   13    23      > JMPZ_EX                                          ~24     !6, ->29
         24    >   INIT_FCALL                                               'password_verify'
         25        SEND_VAR                                                 !1
         26        SEND_VAR                                                 !7
         27        DO_ICALL                                         $25     
         28        BOOL                                             ~24     $25
         29    > > JMPZ                                                     ~24, ->33
   14    30    >   INIT_FCALL_BY_NAME                                       'start_authenticated_session'
         31        DO_FCALL                                      0          
   15    32        ECHO                                                     'You+have+been+logged+in'
   17    33    > > EXIT                                                     'Invalid+username+and+password+combo'
         34*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.56 ms | 1011 KiB | 14 Q