3v4l.org

run code in 300+ PHP versions simultaneously
<?php if($_POST){ $username=$_POST['username']; $password=$_POST['password']; $sql=_query("select * from users where username='$username' and password='$password'"); $res=_num_rows($sql); if($res>0){ $rs_login=_fetch_assoc($sql); $uid=$rs_login['user_id']; $_['sess_uid']=$uid; echo "success"; }else{ echo "invalid username or password"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 34
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 33
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/67AgL
function name:  (null)
number of ops:  35
compiled vars:  !0 = $username, !1 = $password, !2 = $sql, !3 = $res, !4 = $rs_login, !5 = $uid, !6 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_R                      global              ~7      '_POST'
          1      > JMPZ                                                     ~7, ->34
    4     2    >   FETCH_R                      global              ~8      '_POST'
          3        FETCH_DIM_R                                      ~9      ~8, 'username'
          4        ASSIGN                                                   !0, ~9
    5     5        FETCH_R                      global              ~11     '_POST'
          6        FETCH_DIM_R                                      ~12     ~11, 'password'
          7        ASSIGN                                                   !1, ~12
    7     8        INIT_FCALL_BY_NAME                                       '_query'
          9        ROPE_INIT                                     5  ~15     'select+%2A+from+users+where+username%3D%27'
         10        ROPE_ADD                                      1  ~15     ~15, !0
         11        ROPE_ADD                                      2  ~15     ~15, '%27+and+password%3D%27'
         12        ROPE_ADD                                      3  ~15     ~15, !1
         13        ROPE_END                                      4  ~14     ~15, '%27'
         14        SEND_VAL_EX                                              ~14
         15        DO_FCALL                                      0  $18     
         16        ASSIGN                                                   !2, $18
    8    17        INIT_FCALL_BY_NAME                                       '_num_rows'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $20     
         20        ASSIGN                                                   !3, $20
   10    21        IS_SMALLER                                               0, !3
         22      > JMPZ                                                     ~22, ->33
   12    23    >   INIT_FCALL_BY_NAME                                       '_fetch_assoc'
         24        SEND_VAR_EX                                              !2
         25        DO_FCALL                                      0  $23     
         26        ASSIGN                                                   !4, $23
   13    27        FETCH_DIM_R                                      ~25     !4, 'user_id'
         28        ASSIGN                                                   !5, ~25
   14    29        ASSIGN_DIM                                               !6, 'sess_uid'
         30        OP_DATA                                                  !5
   15    31        ECHO                                                     'success'
         32      > JMP                                                      ->34
   19    33    >   ECHO                                                     'invalid+username+or+password'
   22    34    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.98 ms | 1395 KiB | 13 Q